-
Notifications
You must be signed in to change notification settings - Fork 119
103 lines (85 loc) · 2.47 KB
/
coverage.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
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
name: Test coverage
on: [push, pull_request, workflow_dispatch]
env:
OPAMVERBOSE: 1
jobs:
build:
# GitHub allows matrix variables in more places than env variables
strategy:
matrix:
version: [5.2.1]
os: [ubuntu-24.04]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: System dependencies
run: |
sudo apt-get update
sudo apt-get -o Acquire::Retries=3 install build-essential libgmp-dev z3 cvc4 opam cargo verilator
- name: Restore cached opam
id: cache-opam-restore
uses: actions/cache/restore@v3
with:
path: ~/.opam
key: ${{ matrix.os }}-${{ matrix.version }}-cov
- name: Setup opam
if: steps.cache-opam-restore.outputs.cache-hit != 'true'
run: |
opam init --yes --no-setup --shell=sh --compiler=${{ matrix.version }}
- name: Save cached opam
if: steps.cache-opam-restore.outputs.cache-hit != 'true'
id: cache-opam-save
uses: actions/cache/save@v3
with:
path: ~/.opam
key: ${{ steps.cache-opam-restore.outputs.cache-primary-key }}
- name: Install Sail
run: |
eval $(opam env)
opam pin --yes --no-action add .
opam install . --yes --deps-only
- name: Build Sail with coverage
run: |
eval $(opam env)
dune build --release --instrument-with bisect_ppx
dune install
- name: Build sailcov
working-directory: sailcov
run: |
eval $(opam env)
make
- name: Build sailcov library
working-directory: lib/coverage
run: |
make
- name: Test Sail
run: |
eval $(opam env)
export SAIL_DIR=$(pwd)
etc/ci_coverage_tests.sh
- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
with:
name: test-results
path: |
test/**/tests.xml
- name: Collect coverage
run: |
eval $(opam env)
bisect-ppx-report html --coverage-path=test/
bisect-ppx-report summary --per-file --coverage-path=test/ > coverage_summary.txt
- name: Archive coverage
uses: actions/upload-artifact@v3
with:
name: code-coverage
path: |
coverage_summary.txt
_coverage/*
_coverage/src/lib/*
- name: Upload event payload
if: always()
uses: actions/upload-artifact@v3
with:
name: event.json
path: ${{ github.event_path }}