Skip to content

Commit 7e47747

Browse files
committed
ci: modernize GitHub Actions to v4/v5 with Go version and OS matrix
1 parent bf9d768 commit 7e47747

1 file changed

Lines changed: 60 additions & 20 deletions

File tree

.github/workflows/all_tests.yml

Lines changed: 60 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,65 @@
1+
name: CI
2+
13
on: [push, pull_request]
24

35
jobs:
4-
build:
5-
name: Check
6-
runs-on: ubuntu-latest
7-
env:
8-
GO111MODULE: on
9-
10-
steps:
11-
12-
- name: Install libraries
13-
run: |
14-
sudo apt-get update
15-
sudo apt-get install -y libncurses5 libaio1 libnuma1 bash-completion
16-
- name: Set up Go 1.x
17-
uses: actions/setup-go@v2
18-
with:
19-
go-version: ^1.18
6+
lint:
7+
name: Lint
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
13+
- uses: actions/setup-go@v5
14+
with:
15+
go-version: '1.22'
16+
- name: golangci-lint
17+
uses: golangci/golangci-lint-action@v6
18+
with:
19+
version: latest
20+
- name: govulncheck
21+
run: |
22+
go install golang.org/x/vuln/cmd/govulncheck@latest
23+
govulncheck ./...
24+
- name: Copyright check
25+
run: ./scripts/sanity_check.sh copyright
2026

21-
- name: Check out code into the Go module directory
22-
uses: actions/checkout@v2
27+
test:
28+
name: Test (Go ${{ matrix.go-version }}, ${{ matrix.os }})
29+
runs-on: ${{ matrix.os }}
30+
strategy:
31+
matrix:
32+
go-version: ['1.22', '1.23']
33+
os: [ubuntu-latest, macos-latest]
34+
env:
35+
GO111MODULE: on
36+
steps:
37+
- uses: actions/checkout@v4
38+
- uses: actions/setup-go@v5
39+
with:
40+
go-version: ${{ matrix.go-version }}
41+
- name: Install libraries (Linux)
42+
if: runner.os == 'Linux'
43+
run: |
44+
sudo apt-get update
45+
sudo apt-get install -y libncurses5 libaio1 libnuma1 bash-completion
46+
- name: Unit tests
47+
run: ./test/go-unit-tests.sh
2348

24-
- name: tests
25-
run: ./scripts/ci.sh
49+
build:
50+
name: Build
51+
runs-on: ubuntu-latest
52+
needs: [lint, test]
53+
env:
54+
GO111MODULE: on
55+
steps:
56+
- uses: actions/checkout@v4
57+
- uses: actions/setup-go@v5
58+
with:
59+
go-version: '1.22'
60+
- name: Build
61+
run: ./scripts/build.sh linux
62+
- name: Verify executable
63+
run: |
64+
version=$(cat common/VERSION)
65+
test -f "dbdeployer-${version}.linux" || exit 1

0 commit comments

Comments
 (0)