forked from sustainable-computing-io/kepler
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (43 loc) · 1.26 KB
/
unit_test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Unit test
on: # yamllint disable-line rule:truthy
workflow_call:
secrets:
CODECOV_TOKEN:
permissions:
pull-requests: write
contents: write
repository-projects: write
packages: write
jobs:
unit_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
with:
persist-credentials: false
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: sudo apt-get install clang llvm
- name: Get ginkgo
run: make ginkgo-set
env:
GOPATH: /home/runner/go
GOBIN: /home/runner/go/bin
- name: Prepare environment
run: |
sudo apt-get install -y cpuid clang
cd doc/ && sudo ./dev/prepare_dev_env.sh && cd -
git config --global --add safe.directory /kepler
- name: Run
run: |
make VERBOSE=1 test
go tool cover -func=coverage.out -o=coverage.out
- name: Upload coverage reports to Codecov
if: github.event_name != 'pull_request'
uses: codecov/codecov-action@v4.5.0
with:
fail_ci_if_error: false # because codecov updates occasionally fail
files: coverage.out
token: ${{ secrets.CODECOV_TOKEN }}