mirror of
https://github.com/YuzuZensai/netbird-kubernetes-operator.git
synced 2026-09-13 10:49:15 +00:00
Adds code coverage to Go unit tests. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Integrated automated unit test coverage reporting with Codecov integration * Restructured test execution to separate unit and end-to-end tests into distinct workflows <!-- end of auto-generated comment: release notes by coderabbit.ai -->
54 lines
1.6 KiB
YAML
54 lines
1.6 KiB
YAML
name: go
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
|
|
- name: Setup Go
|
|
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c #v6.4.0
|
|
with:
|
|
go-version-file: go.mod
|
|
- name: Run linter
|
|
uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee #v9.2.1
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
|
|
- name: Setup Go
|
|
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c #v6.4.0
|
|
with:
|
|
go-version-file: go.mod
|
|
- name: Verify go mod is not dirty
|
|
run: |
|
|
go mod tidy
|
|
git diff --exit-code
|
|
- name: Verify generate is not dirty
|
|
run: |
|
|
make -B generate
|
|
git diff --exit-code
|
|
- name: Run unit tests
|
|
run: make test-unit
|
|
- name: Upload coverage reports to Codecov
|
|
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 #v6.0.1
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
flags: unit
|
|
e2e:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
|
|
- name: Setup Go
|
|
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c #v6.4.0
|
|
with:
|
|
go-version-file: go.mod
|
|
- name: Run e2e tests
|
|
run: make -B test-e2e
|