-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (46 loc) · 1.44 KB
/
test.yml
File metadata and controls
55 lines (46 loc) · 1.44 KB
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
name: Test OnDemand Loop
on:
workflow_dispatch:
pull_request:
push:
branches: [ main ]
jobs:
build-and-test-ood-loop:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout ${{ github.sha }}
uses: actions/checkout@v6
- name: Run tests
run: make test
coverage-and-badges:
name: Coverage & badges (main only)
needs: build-and-test-ood-loop
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
contents: write
steps:
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Checkout ${{ github.sha }}
uses: actions/checkout@v6
with:
token: ${{ steps.app-token.outputs.token }}
- name: Generate coverage & badges
run: make coverage
- name: Print coverage summary to GitHub Actions UI
run: cat docs/badges/coverage-summary.txt
- name: Git setup
run: |
git config --global user.name "github-actions"
git config --global user.email "github-actions@users.noreply.github.com"
- name: Commit and push badges
run: |
git add docs/badges
git commit -m "Update coverage badges [skip ci]" || echo "No changes"
git push origin main