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: {}
|
2021-06-29 18:27:50 +00:00
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
name: Unit Tests
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-18.04, ubuntu-20.04]
|
|
|
|
timeout-minutes: 20
|
|
|
|
steps:
|
|
|
|
- name: Install Go
|
|
|
|
uses: actions/setup-go@v2
|
2021-07-01 23:08:35 +00:00
|
|
|
with:
|
2022-04-05 20:13:48 +00:00
|
|
|
go-version: '1.18.1'
|
2021-06-29 18:27:50 +00:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
|
|
|
- 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)
|