-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (43 loc) · 1.37 KB
/
run_tests.yaml
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
name: Run Tests
on: [pull_request, workflow_dispatch]
jobs:
Run-Tests:
runs-on: ubuntu-latest
steps:
- name: "get go version"
uses: actions/setup-go@v3
with:
go-version: ^1.19
- name: "checkout repo"
uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- name: "fetch dependencies"
run: go get -t -u ./...
- name: "run test"
env:
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
run: make cicoverage
- name: Go Coverage Badge
uses: tj-actions/[email protected]
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: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add README.md
git commit -m "chore: Updated coverage badge."
- name: Push changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ github.token }}
branch: ${{ github.head_ref }}