forked from Perfect-Abstractions/Compose
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (47 loc) · 1.62 KB
/
coverage.yml
File metadata and controls
55 lines (47 loc) · 1.62 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: Coverage
on:
pull_request:
paths-ignore:
- '**.md'
- 'website/**'
workflow_dispatch:
env:
FOUNDRY_PROFILE: ci
permissions:
contents: read
jobs:
generate-report:
runs-on: ubuntu-latest
steps:
- name: Checkout PR branch
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Run coverage
run: |
forge coverage --ir-minimum --allow-failure --report summary --report lcov
ls -la lcov.info || echo "lcov.info not found"
- name: Generate coverage report
if: github.event_name == 'pull_request'
env:
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
REPO_OWNER: ${{ github.repository_owner }}
REPO_NAME: ${{ github.event.repository.name }}
run: |
node .github/scripts/coverage-comment.js
echo "PR_NUMBER=${{ github.event.pull_request.number }}" >> coverage-data.txt
echo "COMMIT_SHA=${{ github.event.pull_request.head.sha }}" >> coverage-data.txt
echo "REPO_OWNER=${{ github.repository_owner }}" >> coverage-data.txt
echo "REPO_NAME=${{ github.event.repository.name }}" >> coverage-data.txt
echo "Generated coverage report for PR #${{ github.event.pull_request.number }}"
- name: Upload coverage data
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: coverage-data
path: |
coverage-report.md
coverage-data.txt
retention-days: 1