2019-08-27 11:42:46 +00:00
|
|
|
name: main
|
2024-07-05 12:58:54 +00:00
|
|
|
|
2019-08-27 11:42:46 +00:00
|
|
|
on:
|
2023-02-02 12:59:08 +00:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- cluster
|
2024-07-05 12:58:54 +00:00
|
|
|
- master
|
|
|
|
paths:
|
|
|
|
- '**.go'
|
2023-02-02 12:59:08 +00:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- cluster
|
2024-07-05 12:58:54 +00:00
|
|
|
- master
|
|
|
|
paths:
|
|
|
|
- '**.go'
|
|
|
|
|
2022-04-16 23:56:39 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2023-02-07 02:12:16 +00:00
|
|
|
concurrency:
|
|
|
|
cancel-in-progress: true
|
2024-07-05 12:58:54 +00:00
|
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
2023-02-07 02:12:16 +00:00
|
|
|
|
2019-08-27 11:42:46 +00:00
|
|
|
jobs:
|
2023-02-02 12:59:08 +00:00
|
|
|
lint:
|
|
|
|
name: lint
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Code checkout
|
2023-09-07 11:07:56 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-02-02 12:59:08 +00:00
|
|
|
|
|
|
|
- name: Setup Go
|
2023-11-21 10:00:47 +00:00
|
|
|
id: go
|
2023-12-08 13:55:31 +00:00
|
|
|
uses: actions/setup-go@v5
|
2023-02-02 12:59:08 +00:00
|
|
|
with:
|
2023-11-20 22:58:41 +00:00
|
|
|
cache: false
|
2024-07-05 12:58:54 +00:00
|
|
|
go-version: stable
|
2023-02-02 12:59:08 +00:00
|
|
|
|
2023-11-20 22:58:41 +00:00
|
|
|
- name: Cache Go artifacts
|
2024-02-13 17:35:44 +00:00
|
|
|
uses: actions/cache@v4
|
2023-11-20 22:58:41 +00:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cache/go-build
|
|
|
|
~/go/bin
|
2024-07-05 12:58:54 +00:00
|
|
|
~/go/pkg/mod
|
2023-11-21 10:00:47 +00:00
|
|
|
key: go-artifacts-${{ runner.os }}-check-all-${{ steps.go.outputs.go-version }}-${{ hashFiles('go.sum', 'Makefile', 'app/**/Makefile') }}
|
2023-11-20 22:58:41 +00:00
|
|
|
restore-keys: go-artifacts-${{ runner.os }}-check-all-
|
|
|
|
|
|
|
|
- name: Run check-all
|
2023-02-02 12:59:08 +00:00
|
|
|
run: |
|
|
|
|
make check-all
|
|
|
|
git diff --exit-code
|
|
|
|
|
2024-07-05 12:58:54 +00:00
|
|
|
test:
|
|
|
|
name: test
|
2023-02-02 12:59:08 +00:00
|
|
|
needs: lint
|
2019-08-27 11:42:46 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-02-02 12:59:08 +00:00
|
|
|
|
2023-11-20 22:58:41 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-07-05 12:58:54 +00:00
|
|
|
scenario:
|
|
|
|
- 'test-full'
|
|
|
|
- 'test-full-386'
|
|
|
|
- 'test-pure'
|
|
|
|
|
2023-02-02 12:59:08 +00:00
|
|
|
steps:
|
|
|
|
- name: Code checkout
|
2023-09-07 11:07:56 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-01-18 19:42:27 +00:00
|
|
|
|
2019-08-27 11:42:46 +00:00
|
|
|
- name: Setup Go
|
2023-11-21 10:00:47 +00:00
|
|
|
id: go
|
2023-12-08 13:55:31 +00:00
|
|
|
uses: actions/setup-go@v5
|
2019-08-27 11:42:46 +00:00
|
|
|
with:
|
2023-11-20 22:58:41 +00:00
|
|
|
cache: false
|
2024-07-05 12:58:54 +00:00
|
|
|
go-version: stable
|
2023-01-18 19:42:27 +00:00
|
|
|
|
2023-11-20 22:58:41 +00:00
|
|
|
- name: Cache Go artifacts
|
2024-02-13 17:35:44 +00:00
|
|
|
uses: actions/cache@v4
|
2023-02-07 02:12:16 +00:00
|
|
|
with:
|
2023-11-20 22:58:41 +00:00
|
|
|
path: |
|
|
|
|
~/.cache/go-build
|
|
|
|
~/go/bin
|
2024-07-05 12:58:54 +00:00
|
|
|
~/go/pkg/mod
|
2023-11-21 10:00:47 +00:00
|
|
|
key: go-artifacts-${{ runner.os }}-${{ matrix.scenario }}-${{ steps.go.outputs.go-version }}-${{ hashFiles('go.sum', 'Makefile', 'app/**/Makefile') }}
|
2023-11-20 22:58:41 +00:00
|
|
|
restore-keys: go-artifacts-${{ runner.os }}-${{ matrix.scenario }}-
|
2023-02-07 02:12:16 +00:00
|
|
|
|
2024-07-05 12:58:54 +00:00
|
|
|
- name: Run tests
|
2023-11-20 22:58:41 +00:00
|
|
|
run: make ${{ matrix.scenario}}
|
|
|
|
|
|
|
|
- name: Publish coverage
|
2024-11-20 15:37:54 +00:00
|
|
|
uses: codecov/codecov-action@v5
|
2023-11-20 22:58:41 +00:00
|
|
|
with:
|
|
|
|
file: ./coverage.txt
|
2024-11-20 15:30:55 +00:00
|
|
|
|
|
|
|
integration-test:
|
|
|
|
name: integration-test
|
|
|
|
needs: [lint, test]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Code checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Setup Go
|
|
|
|
id: go
|
|
|
|
uses: actions/setup-go@v5
|
|
|
|
with:
|
|
|
|
cache: false
|
|
|
|
go-version: stable
|
|
|
|
|
|
|
|
- name: Cache Go artifacts
|
|
|
|
uses: actions/cache@v4
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cache/go-build
|
|
|
|
~/go/bin
|
|
|
|
~/go/pkg/mod
|
|
|
|
key: go-artifacts-${{ runner.os }}-${{ matrix.scenario }}-${{ steps.go.outputs.go-version }}-${{ hashFiles('go.sum', 'Makefile', 'app/**/Makefile') }}
|
|
|
|
restore-keys: go-artifacts-${{ runner.os }}-${{ matrix.scenario }}-
|
|
|
|
|
|
|
|
- name: Run integration tests
|
|
|
|
run: make integration-test
|