-
Notifications
You must be signed in to change notification settings - Fork 899
106 lines (92 loc) · 3.25 KB
/
run-mddbench.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
104
105
106
name: Build Yosys and run under mddbench
on: [push, pull_request]
jobs:
pre-job:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
paths_ignore: '["**/README.md", "docs/**", "guidelines/**", "tests/**", "examples/**"]'
# cancel previous builds if a new commit is pushed
cancel_others: 'true'
# only run on push *or* pull_request, not both
concurrent_skipping: 'same_content_newer'
build-yosys:
runs-on: [self-hosted, linux, x64]
needs: [pre-job]
if: needs.pre_job.outputs.should_skip != 'true'
outputs:
yosys-key: ${{ steps.rte.outputs.yosys-key }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
submodules: true
- name: Runtime environment
id: rte
run: |
echo "procs=$(nproc)" >> $GITHUB_ENV
echo "yosys-key=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Cache Yosys
id: cache-yosys
uses: actions/cache@v4
with:
path: .local/yosys/
key: linux-${{ steps.rte.outputs.yosys-key }}
- name: Build Yosys
if: steps.cache-yosys.outputs.cache-hit != 'true'
run: |
make config-clang
echo "ENABLE_VERIFIC := 1" >> Makefile.conf
echo "ENABLE_VERIFIC_EDIF := 1" >> Makefile.conf
echo "ENABLE_VERIFIC_LIBERTY := 1" >> Makefile.conf
echo "ENABLE_VERIFIC_YOSYSHQ_EXTENSIONS := 1" >> Makefile.conf
echo "ENABLE_CCACHE := 1" >> Makefile.conf
make -j${{ env.procs }} ENABLE_LTO=1
make install DESTDIR=${GITHUB_WORKSPACE}/.local/yosys PREFIX=
- name: Configure mddbench
run: |
sed -i -e 's|{YOSYS_KEY}|'${{ env.YOSYS_KEY }}'|g' mddbench-config.yaml
- name: Store mddbench-config
uses: actions/upload-artifact@v4
with:
name: mddbench-config
path: mddbench-config.yaml
retention-days: 1
base:
runs-on: [self-hosted, linux, x64, long]
needs: [build-yosys, pre-job]
if: needs.pre_job.outputs.should_skip != 'true'
env:
YOSYS_KEY: ${{ needs.build-yosys.outputs.yosys-key }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: https://github.com/YosysHQ/mddbench
submodules: recursive
- name: Runtime environment
run: |
echo "procs=$(nproc)" >> $GITHUB_ENV
- name: Restore Yosys
uses: actions/cache/restore@v4
with:
path: .local/yosys/
key: linux-${{ env.YOSYS_KEY }}
fail-on-cache-miss: true
- name: Download mddbench-config
uses: actions/download-artifact@v4
with:
name: mddbench-config
- name: Setup mddbench
run: |
sed -e 's|{GITHUB_WORKSPACE}|'${GITHUB_WORKSPACE}'|g' < mddbench-config.yaml > config.yaml
pip install -r scripts/requirements.txt
- name: Run mddbench
run: |
python3 -m scripts.mau_runner -j${{ env.procs }} -Eg --flowgroup=base
cat gh.md >> $GITHUB_STEP_SUMMARY