Skip to content

Commit 2bcb45f

Browse files
chore: add test and lint workflow
1 parent a1ca648 commit 2bcb45f

File tree

1 file changed

+29
-33
lines changed

1 file changed

+29
-33
lines changed

.github/workflows/run-test.yaml

Lines changed: 29 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,40 @@
1-
name: CICD
1+
name: Test and Lint
2+
23
on:
34
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
49
jobs:
5-
Describe:
10+
lint:
611
runs-on: ubuntu-latest
712
steps:
8-
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
9-
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
10-
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
11-
- name: Check out repository code
12-
uses: actions/checkout@v3
13-
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
14-
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
15-
- name: List files in the repository
16-
run: |
17-
ls ${{ github.workspace }}
18-
- run: echo "🍏 This job's status is ${{ job.status }}."
19-
test-unix:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-go@v5
15+
with:
16+
go-version: "1.23"
17+
cache: true
18+
- name: Install Task
19+
uses: arduino/setup-task@v2
20+
- name: Run lint
21+
run: task lint
22+
23+
test:
2024
strategy:
2125
fail-fast: false
2226
matrix:
23-
platform:
24-
- ubuntu
25-
- macOS
26-
go:
27-
- 21
28-
name: '${{ matrix.platform }} | 1.${{ matrix.go }}.x'
29-
runs-on: ${{ matrix.platform }}-latest
27+
os: [ubuntu-latest, macos-latest, windows-latest]
28+
go: ["1.21", "1.22", "1.23"]
29+
name: "${{ matrix.os }} | ${{ matrix.go }}"
30+
runs-on: ${{ matrix.os }}
3031
steps:
31-
- uses: actions/checkout@v3
32-
- uses: actions/setup-go@v3
32+
- uses: actions/checkout@v4
33+
- uses: actions/setup-go@v5
3334
with:
34-
go-version: 1.${{ matrix.go }}.x
35+
go-version: ${{ matrix.go }}
3536
cache: true
36-
- run: |
37-
export GOBIN=$HOME/go/bin
38-
case "${{ matrix.go }}" in
39-
14|15) _version='';;
40-
*) _version='@latest';;
41-
esac
42-
go install github.com/kyoh86/richgo"${_version}"
43-
go install github.com/mitchellh/gox"${_version}"
44-
- run: RICHGO_FORCE_COLOR=1 PATH=$HOME/go/bin/:$PATH make test
37+
- name: Install Task
38+
uses: arduino/setup-task@v2
39+
- name: Run tests
40+
run: task test

0 commit comments

Comments
 (0)