Skip to content

Commit 25c8440

Browse files
committed
chore: create separate lint workflow
1 parent 9d76a1b commit 25c8440

File tree

2 files changed

+54
-58
lines changed

2 files changed

+54
-58
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -7,71 +7,44 @@ on:
77
pull_request:
88

99
jobs:
10-
# setup:
11-
# runs-on: ubuntu-latest
12-
# steps:
13-
# - name: Checkout code
14-
# uses: actions/checkout@v4
15-
16-
# - name: Set up Go
17-
# uses: actions/setup-go@v5
18-
# with:
19-
# go-version-file: go.mod
20-
21-
# build:
22-
# runs-on: ubuntu-latest
23-
# needs: setup
24-
# steps:
25-
# - name: Checkout code
26-
# uses: actions/checkout@v4
27-
28-
# - name: Setup Mage
29-
# uses: magefile/mage-action@v3
30-
# with:
31-
# install-only: true
32-
33-
# - name: Build
34-
# run: |
35-
# mage -v build
36-
37-
lint:
10+
build:
3811
runs-on: ubuntu-latest
39-
# needs: build
4012
steps:
41-
- uses: actions/checkout@v4
42-
43-
- name: Set up Go
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
- name: Setup go
4416
uses: actions/setup-go@v5
4517
with:
46-
go-version-file: "go.mod"
47-
18+
go-version-file: go.mod
4819
- name: Setup Mage
49-
run: go install github.com/magefile/mage@latest
50-
51-
- name: Setup CI Linter
52-
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.54.2
20+
uses: magefile/mage-action@v3
21+
with:
22+
install-only: true
5323

54-
- name: Lint
24+
- name: Build
5525
run: |
56-
mage -v lint
26+
mage -v build
5727
58-
# test:
59-
# runs-on: ubuntu-latest
60-
# needs: lint
61-
# steps:
62-
# - name: Checkout code
63-
# uses: actions/checkout@v4
64-
65-
# - name: Install dependencies
66-
# run: |
67-
# sudo apt update
68-
# sudo apt install -y gcc
28+
test:
29+
runs-on: ubuntu-latest
30+
needs: build
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
- name: Setup go
35+
uses: actions/setup-go@v5
36+
with:
37+
go-version-file: go.mod
38+
- name: Install dependencies
39+
run: |
40+
sudo apt update
41+
sudo apt install -y gcc
6942
70-
# - name: Setup Mage
71-
# uses: magefile/mage-action@v3
72-
# with:
73-
# install-only: true
43+
- name: Setup Mage
44+
uses: magefile/mage-action@v3
45+
with:
46+
install-only: true
7447

75-
# - name: Test
76-
# run: |
77-
# CGO_ENABLED=1 mage -v testRace
48+
- name: Test
49+
run: |
50+
CGO_ENABLED=1 mage -v testRace

.github/workflows/lint.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: golangci-lint
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
golangci:
13+
name: lint
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-go@v5
18+
with:
19+
go-version: stable
20+
- name: golangci-lint
21+
uses: golangci/golangci-lint-action@v6
22+
with:
23+
version: v1.54.2

0 commit comments

Comments
 (0)