-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (100 loc) · 3.35 KB
/
pr-development-workflow.yml
File metadata and controls
116 lines (100 loc) · 3.35 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: PR development - Build and Run Tests Workflow
# if statements modified to avoid: https://stackoverflow.com/questions/69354003/github-action-job-fire-when-previous-job-skipped
on:
workflow_call:
inputs:
os:
required: true
type: string
arch:
required: true
type: string
permissions:
contents: read
env:
REGISTRY: ghcr.io
DOCKERIMAGE: ghcr.io/algebraic-programming/hicr/buildenv
defaults:
run:
shell: bash
jobs:
# Build HiCR and run tests and the remote image
compile-and-test-standard:
runs-on: ${{ inputs.os }}
container:
image: ghcr.io/algebraic-programming/hicr/buildenv:latest
options: --user hicr
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup
run: source /home/hicr/.bashrc && meson setup build -Dengines=mpi,cloudr,local,lpf -Db_coverage=true -DbuildTests=true -DbuildExamples=true -DcompileWarningsAsErrors=true
- name: Compile
run: source /home/hicr/.bashrc && meson compile -C build
- name: Running tests and creating coverage report
shell: bash
run: |
echo "Running Tests..."
source /home/hicr/.bashrc
meson test -C build
echo "Creating coverage report..."
ninja -C build coverage
- uses: actions/upload-artifact@v4
with:
name: build-standard-${{ inputs.arch }}
path: build/
analyze-coverage-report:
runs-on: ubuntu-latest
needs: [compile-and-test-standard]
permissions:
pull-requests: write
if: |
always() &&
(contains(needs.compile-and-test-standard.result, 'success'))
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Create temp build folder
run: |
mkdir ${{ runner.temp }}/build
- name: Download standard coverage file
if: ${{ needs.compile-and-test-standard.result == 'success' }}
uses: actions/download-artifact@v4
with:
name: build-standard-${{ inputs.arch }}
path: ${{ runner.temp }}/build
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Copy build folder in repo
run: |
mv ${{ runner.temp }}/build .
- name: Code Coverage Report
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: build/meson-logs/coverage.xml
badge: true
fail_below_min: true
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: "60 80"
- name: Add arch to coverage file
run: |
sed -i '1i # Coverage ${{ inputs.arch }}' code-coverage-results.md
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request' || github.event_name == 'pull_request'
with:
header: ${{ inputs.arch }}
message: |
Coverage for ${{ inputs.arch }}
recreate: true
path: code-coverage-results.md
- uses: actions/upload-artifact@v4
with:
name: meson-logs-${{ inputs.arch }}
path: build/meson-logs/