2021-06-29 18:27:50 +00:00
|
|
|
name: Unit Test Coverage
|
2021-10-29 16:47:37 +00:00
|
|
|
on:
|
2021-07-23 14:29:00 +00:00
|
|
|
push:
|
2021-10-29 16:47:37 +00:00
|
|
|
paths-ignore:
|
2021-07-23 14:29:00 +00:00
|
|
|
- "**.md"
|
2021-11-15 18:50:38 +00:00
|
|
|
- "channel.yaml"
|
2021-10-29 16:47:37 +00:00
|
|
|
- "install.sh"
|
2022-03-15 17:29:56 +00:00
|
|
|
- "tests/snapshotter/**"
|
|
|
|
- "tests/install/**"
|
|
|
|
- "tests/cgroup/**"
|
2021-11-15 18:50:38 +00:00
|
|
|
- ".github/**"
|
|
|
|
- "!.github/workflows/unitcoverage.yaml"
|
2021-07-23 14:29:00 +00:00
|
|
|
pull_request:
|
|
|
|
paths-ignore:
|
|
|
|
- "**.md"
|
2021-11-15 18:50:38 +00:00
|
|
|
- "channel.yaml"
|
2021-10-29 16:47:37 +00:00
|
|
|
- "install.sh"
|
2022-03-15 17:29:56 +00:00
|
|
|
- "tests/snapshotter/**"
|
|
|
|
- "tests/install/**"
|
|
|
|
- "tests/cgroup/**"
|
2021-11-15 18:50:38 +00:00
|
|
|
- ".github/**"
|
|
|
|
- "!.github/workflows/unitcoverage.yaml"
|
2021-08-27 06:40:06 +00:00
|
|
|
workflow_dispatch: {}
|
2023-01-12 21:57:57 +00:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2021-06-29 18:27:50 +00:00
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
name: Unit Tests
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-11-21 20:58:50 +00:00
|
|
|
os: [ubuntu-20.04, ubuntu-22.04]
|
2021-06-29 18:27:50 +00:00
|
|
|
timeout-minutes: 20
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-10-06 17:50:46 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-06-29 18:27:50 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
2022-10-06 17:50:46 +00:00
|
|
|
- name: Install Go
|
|
|
|
uses: actions/setup-go@v3
|
|
|
|
with:
|
2023-01-19 15:56:32 +00:00
|
|
|
go-version: '1.19.5'
|
2022-10-06 17:50:46 +00:00
|
|
|
check-latest: true
|
|
|
|
cache: true
|
|
|
|
cache-dependency-path: |
|
|
|
|
**/go.sum
|
|
|
|
**/go.mod
|
2021-06-29 18:27:50 +00:00
|
|
|
- name: Run Unit Tests
|
|
|
|
run: |
|
2021-07-26 16:59:33 +00:00
|
|
|
go test -coverpkg=./... -coverprofile=coverage.out ./pkg/... -run Unit
|
2021-06-29 18:27:50 +00:00
|
|
|
go tool cover -func coverage.out
|
2021-07-01 23:08:35 +00:00
|
|
|
- name: On Failure, Launch Debug Session
|
|
|
|
if: ${{ failure() }}
|
|
|
|
uses: mxschmitt/action-tmate@v3
|
2021-07-26 16:59:33 +00:00
|
|
|
timeout-minutes: 5
|
2021-06-29 18:27:50 +00:00
|
|
|
- name: Upload Results To Codecov
|
|
|
|
uses: codecov/codecov-action@v1
|
|
|
|
with:
|
|
|
|
files: ./coverage.out
|
|
|
|
flags: unittests # optional
|
|
|
|
verbose: true # optional (default = false)
|