2023-01-06 12:33:50 +01:00
|
|
|
name: Tests
|
2023-01-06 10:25:16 +01:00
|
|
|
|
2022-02-18 01:47:35 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2023-02-09 15:17:23 +01:00
|
|
|
- '*'
|
2022-02-18 01:47:35 +00:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- 'main'
|
|
|
|
- 'release*'
|
|
|
|
|
2023-01-06 12:33:50 +01:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2022-08-23 22:02:13 +02:00
|
|
|
permissions:
|
2022-02-18 01:47:35 +00:00
|
|
|
contents: read
|
|
|
|
|
|
|
|
jobs:
|
2023-01-06 21:42:21 +01:00
|
|
|
tests:
|
2022-02-18 01:47:35 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-01-06 06:50:37 +00:00
|
|
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
2023-01-05 16:52:52 +01:00
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
2023-01-06 12:33:50 +01:00
|
|
|
with:
|
|
|
|
build-cache-key: pre-checks
|
2022-08-24 15:08:24 +02:00
|
|
|
- name: golangci-lint
|
2023-01-24 13:38:11 +00:00
|
|
|
uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # v3.4.0
|
2022-02-18 01:47:35 +00:00
|
|
|
with:
|
2022-08-24 15:08:24 +02:00
|
|
|
version: v1.48
|
2023-01-06 12:33:50 +01:00
|
|
|
skip-cache: true
|
2023-01-06 21:42:21 +01:00
|
|
|
- name: go fmt check
|
|
|
|
run: make fmt-check
|
|
|
|
- name: goimports check
|
|
|
|
run: make imports-check
|
2022-02-18 01:47:35 +00:00
|
|
|
- name: Checking unused pkgs using go mod tidy
|
2023-01-06 21:42:21 +01:00
|
|
|
run: make unused-package-check
|
2022-04-05 17:52:13 +02:00
|
|
|
- name: Go vet
|
2023-01-06 21:42:21 +01:00
|
|
|
run: make vet
|
|
|
|
- name: Unit test
|
|
|
|
run: make test-unit
|