Skip to content

Commit bc751bd

Browse files
committed
github actions
1 parent 90e932f commit bc751bd

File tree

2 files changed

+101
-0
lines changed

2 files changed

+101
-0
lines changed

.github/pull_request_template.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
### Scope of changes
2+
3+
[Brief Description of the Changes]
4+
5+
<!-- Fixes SC-XXXX -->
6+
7+
### Type of change
8+
9+
- [ ] new feature
10+
- [ ] bug fix
11+
- [ ] documentation
12+
- [ ] testing
13+
- [ ] technical debt
14+
- [ ] other (describe)
15+
16+
### Author checklist
17+
18+
- [ ] I have manually tested the change and/or added automation in the form of unit tests or integration tests
19+
- [ ] I have added new test fixtures as needed to support added tests
20+
- [ ] Check this box if a reviewer can merge this pull request after approval (leave it unchecked if you want to do it yourself)
21+
- [ ] I have moved the associated Shortcut story to "Ready for Review"
22+
23+
### Reviewer(s) checklist
24+
25+
- [ ] Any new user-facing content that has been added for this PR has been QA'ed to ensure correct grammar, spelling, and understandability.
26+
- [ ] Are there any TODOs in this PR that should be turned into stories?

.github/workflows/test.yaml

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Tests
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- "v*"
7+
tags:
8+
- "v*"
9+
pull_request:
10+
11+
jobs:
12+
lint:
13+
name: Go Lint
14+
runs-on: ubuntu-latest
15+
env:
16+
GOPATH: ${{ github.workspace }}/go
17+
GOBIN: ${{ github.workspace }}/go/bin
18+
defaults:
19+
run:
20+
working-directory: ${{ env.GOPATH }}/src/go.rtnl.ai/x
21+
steps:
22+
- name: Set up Go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version: 1.23.x
26+
27+
- name: Checkout Code
28+
uses: actions/checkout@v4
29+
with:
30+
path: ${{ env.GOPATH }}/src/go.rtnl.ai/x
31+
32+
- name: Install Staticcheck
33+
run: go install honnef.co/go/tools/cmd/[email protected]
34+
35+
- name: Lint Go Code
36+
run: staticcheck ./...
37+
38+
test:
39+
name: Go Test
40+
runs-on: ubuntu-latest
41+
strategy:
42+
fail-fast: true
43+
matrix:
44+
go-version: [1.22.x, 1.23.x]
45+
env:
46+
GOPATH: ${{ github.workspace }}/go
47+
GOBIN: ${{ github.workspace }}/go/bin
48+
defaults:
49+
run:
50+
working-directory: ${{ env.GOPATH }}/src/go.rtnl.ai/x
51+
steps:
52+
- name: Set up Go
53+
uses: actions/setup-go@v5
54+
with:
55+
go-version: ${{ matrix.go-version }}
56+
57+
- name: Cache Speedup
58+
uses: actions/cache@v4
59+
with:
60+
path: ~/go/pkg/mod
61+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
62+
restore-keys: |
63+
${{ runner.os }}-go-
64+
65+
- name: Checkout Code
66+
uses: actions/checkout@v4
67+
with:
68+
path: ${{ env.GOPATH }}/src/go.rtnl.ai/x
69+
70+
- name: Install Dependencies
71+
run: |
72+
go version
73+
74+
- name: Run Unit Tests
75+
run: go test -v -coverprofile=coverage.txt -covermode=atomic --race ./...

0 commit comments

Comments
 (0)