|
| 1 | +name: CI |
| 2 | + |
1 | 3 | on: [push, pull_request] |
2 | 4 |
|
3 | 5 | 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 |
20 | 26 |
|
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 |
23 | 48 |
|
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