This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
forked from sustainable-computing-io/kepler
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (61 loc) · 1.9 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Unit test
on:
workflow_call:
secrets:
GH_BOT_SECRET:
permissions:
pull-requests: write
contents: write
repository-projects: write
packages: write
jobs:
unit_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version-file: go.mod
- name: Get ginkgo
run: make ginkgo-set
env:
GOPATH: /home/runner/go
GOBIN: /home/runner/go/bin
- name: install bcc
uses: sustainable-computing-io/[email protected]
with:
ebpfprovider: bcc
- name: Prepare environment
run: |
sudo apt-get install -y cpuid
cd doc/ && sudo ./dev/prepare_dev_env.sh && cd -
git config --global --add safe.directory /kepler
- name: Run
run: |
make test-verbose
go tool cover -func=coverage.out -o=coverage.out
- name: Go Coverage Badge # Pass the `coverage.out` output to this action
uses: tj-actions/coverage-badge-go@v2
with:
filename: coverage.out
- name: Verify Changed files
uses: tj-actions/[email protected]
id: verify-changed-files
with:
files: README.md
- name: Commit changes
if: github.event_name != 'pull_request' && steps.verify-changed-files.outputs.files_changed == 'true'
run: |
git config --local user.email "[email protected]"
git config --local user.name "sustainable-computing-bot"
git add README.md
git commit -m "bot: Updated coverage badge." -s
- name: Push changes
if: github.event_name != 'pull_request' && steps.verify-changed-files.outputs.files_changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GH_BOT_SECRET }}
branch: ${{ github.head_ref }}