-
-
Notifications
You must be signed in to change notification settings - Fork 33
71 lines (61 loc) · 1.96 KB
/
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
68
69
70
71
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, windows-latest, macos-latest, macos-11, windows-2022]
name: Test coverage-badge-go
steps:
- name: Checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4
with:
fetch-depth: 0
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
- name: golangci-lint
uses: reviewdog/action-golangci-lint@v2
with:
workdir: test
go_version: "1.14.4"
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: 'test/go.mod'
cache: false
- name: Run Test
run:
make test
working-directory: test
- name: Run coverage-badge-go
uses: ./
with:
filename: test/coverage.out
link: ${{ github.server_url }}/${{ github.repository }}/actions/workflows/test.yml
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v13.1
id: verify-changed-files
with:
files: README.md
- name: README.md changed
if: steps.verify-changed-files.outputs.files_changed == 'true' && github.event_name != 'pull_request' && runner.os == 'Linux'
run: |
echo "README.md has uncommited changes"
exit 1
- name: Create Pull Request
if: failure() && github.event_name != 'pull_request' && runner.os == 'Linux'
uses: peter-evans/create-pull-request@v6
with:
base: "main"
title: "chore: updated coverage badge"
branch: "chore/update-coverage"
commit-message: "chore: updated coverage badge"
body: "updated coverage badge"
token: ${{ secrets.PAT_TOKEN }}