Skip to content

Commit be4d28d

Browse files
committed
chore: install mage as action
1 parent 8d8f2be commit be4d28d

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,38 @@ on:
77
pull_request:
88

99
env:
10-
GO_VERSION: 1.22
1110
GOLANGCI_LINT_VERSION: v1.54.2
1211

1312
jobs:
1413
setup:
1514
runs-on: ubuntu-latest
16-
outputs:
17-
go-path: ${{ steps.set-go-path.outputs.go-path }}
1815
steps:
1916
- name: Checkout code
20-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
2118

2219
- name: Set up Go
2320
id: set-go
24-
uses: actions/setup-go@v4
21+
uses: actions/setup-go@v5
2522
with:
26-
go-version: ${{env.GO_VERSION}}
27-
28-
- name: Install Mage
29-
id: set-go-path
30-
run: |
31-
go install github.com/magefile/mage@latest
32-
echo "$HOME/go/bin" >> $GITHUB_PATH # Add Go binaries to the PATH
33-
echo "::set-output name=go-path::$HOME/go/bin"
23+
go-version-file: go.mod
3424

3525
build:
3626
runs-on: ubuntu-latest
37-
needs: setup # This job will run after the setup job completes
27+
needs: setup
3828
steps:
3929
- name: Checkout code
4030
uses: actions/checkout@v3
4131

32+
- name: Run Mage
33+
uses: magefile/mage-action@v3
34+
4235
- name: Build
4336
run: |
4437
mage -v build
4538
4639
lint:
4740
runs-on: ubuntu-latest
48-
needs: setup # This job will run after the setup job completes
41+
needs: setup
4942
steps:
5043
- name: Checkout code
5144
uses: actions/checkout@v3
@@ -55,13 +48,16 @@ jobs:
5548
wget -qO - https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ${{ needs.setup.outputs.go-path }} ${{env.GOLANGCI_LINT_VERSION}}
5649
echo "$HOME/go/bin" >> $GITHUB_PATH # Add golangci-lint to the PATH
5750
51+
- name: Run Mage
52+
uses: magefile/mage-action@v3
53+
5854
- name: Lint
5955
run: |
6056
mage -v lint # Run your lint command, which uses golangci-lint
6157
6258
test:
6359
runs-on: ubuntu-latest
64-
needs: setup # This job will run after the setup job completes
60+
needs: setup
6561
steps:
6662
- name: Checkout code
6763
uses: actions/checkout@v3
@@ -71,6 +67,9 @@ jobs:
7167
sudo apt update
7268
sudo apt install -y gcc
7369
70+
- name: Run Mage
71+
uses: magefile/mage-action@v3
72+
7473
- name: Test
7574
run: |
7675
CGO_ENABLED=1 mage -v testRace

0 commit comments

Comments
 (0)