Skip to content

Commit 44a23f2

Browse files
committed
ci: Refactor CI workflows
1 parent 78e4600 commit 44a23f2

File tree

2 files changed

+62
-43
lines changed

2 files changed

+62
-43
lines changed
Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,10 @@
1-
name: "Testing and release preparation"
1+
name: "Prepare release artifacts"
22

33
on:
44
push:
5-
branches: [ master, dev ]
65
tags: [ "v*" ]
7-
pull_request:
8-
branches: [ master, dev ]
96

107
jobs:
11-
build-and-test:
12-
name: "Build and test"
13-
runs-on: ubuntu-latest
14-
steps:
15-
- uses: actions/checkout@v2
16-
- name: "Install libpam"
17-
run: |
18-
sudo apt-get update
19-
sudo apt-get install -y libpam-dev
20-
- uses: actions/cache@v2
21-
with:
22-
path: |
23-
~/.cache/go-build
24-
~/go/pkg/mod
25-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
26-
restore-keys: ${{ runner.os }}-go-
27-
- uses: actions/setup-go@v2
28-
with:
29-
go-version: 1.19
30-
- name: "Verify build.sh"
31-
run: |
32-
./build.sh
33-
./build.sh --destdir destdir/ install
34-
find destdir/
35-
- name: "Unit & module tests"
36-
run: |
37-
go test ./... -coverprofile=coverage.out -covermode=atomic
38-
- name: "Integration tests"
39-
run: |
40-
cd tests/
41-
./run.sh
42-
- uses: codecov/codecov-action@v2
43-
with:
44-
files: ./coverage.out
45-
flags: unit
46-
- uses: codecov/codecov-action@v2
47-
with:
48-
files: ./tests/coverage.out
49-
flags: integration
508
artifact-builder:
519
name: "Prepare release artifacts"
5210
needs: build-and-test

.github/workflows/test.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: "Testing"
2+
3+
on:
4+
push:
5+
branches: [ master, dev ]
6+
tags: [ "v*" ]
7+
pull_request:
8+
branches: [ master, dev ]
9+
10+
jobs:
11+
golangci:
12+
name: lint
13+
runs-on: ubuntu-24.04
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-go@v5
17+
with:
18+
go-version-file: 'go.mod'
19+
- uses: golangci/golangci-lint-action@v6
20+
with:
21+
version: v1.60
22+
buildsh:
23+
name: "Verify build.sh"
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: actions/setup-go@v5
28+
with:
29+
go-version-file: 'go.mod'
30+
- name: "Install libpam"
31+
run: |
32+
sudo apt-get update
33+
sudo apt-get install -y libpam-dev
34+
- name: "Verify build.sh"
35+
run: |
36+
./build.sh
37+
./build.sh --destdir destdir/ install
38+
find destdir/
39+
test:
40+
name: "Build and test"
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v4
44+
- uses: actions/setup-go@v5
45+
with:
46+
go-version-file: 'go.mod'
47+
- name: "Unit & module tests"
48+
run: |
49+
go test ./... -coverprofile=coverage.out -covermode=atomic
50+
- name: "Integration tests"
51+
run: |
52+
cd tests/
53+
./run.sh
54+
- uses: codecov/codecov-action@v2
55+
with:
56+
files: ./coverage.out
57+
flags: unit
58+
- uses: codecov/codecov-action@v2
59+
with:
60+
files: ./tests/coverage.out
61+
flags: integration

0 commit comments

Comments
 (0)