-
Notifications
You must be signed in to change notification settings - Fork 6
157 lines (135 loc) · 4.01 KB
/
test.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: Verilator Verification Features Tests
on:
push:
branches:
- main
pull_request:
schedule:
- cron: "0 7 * * *"
jobs:
matrix:
name: Generate test matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.make_matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
clean: false
- name: Make build matrix
id: make_matrix
run: echo "matrix=$(ls verilator | jq -R -s -c 'split("\n")[:-1]')" >> "$GITHUB_OUTPUT"
test:
name: Test branch ${{ matrix.VERILATOR_BRANCH }}
needs: matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
VERILATOR_BRANCH: ${{fromJson(needs.matrix.outputs.matrix)}}
env:
CCACHE_COMPRESS: 1
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_LIMIT_MULTIPLE: 0.95
CCACHE_MAXSIZE: 150M
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
clean: false
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install gcc-11 g++-11
sudo apt-get -y install bison flex libfl-dev
sudo apt-get -y install ccache
sudo apt-get -y install python3-pip python3-setuptools
sudo apt-get -y install help2man
sudo apt-get -y install z3
sudo pip3 install pyyaml
sudo pip3 install jinja2
sudo pip3 install robotframework
- name: Cache $CCACHE_DIR
uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ matrix.VERILATOR_BRANCH }}
- name: Setup repository
run: scripts/build_and_run --setup
- name: Build Verilator
env:
CC: gcc-11
CXX: g++-11
run: scripts/build_and_run --build ${{ matrix.VERILATOR_BRANCH }}
- name: Generate Robot test files
run: scripts/build_and_run --gen-tests ${{ matrix.VERILATOR_BRANCH }}
- name: Run tests
run: scripts/build_and_run --run-tests
- name: Upload test output
uses: actions/upload-artifact@v4
with:
path: "*.xml"
name: output-${{ matrix.VERILATOR_BRANCH }}
automerge:
name: Automerge dependabot pull requests
needs: [test]
if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Trigger automerge
run: GITHUB_TOKEN='${{ github.token }}' gh pr merge '${{ github.event.pull_request.html_url }}' --squash
report:
name: Generate test report
needs: [test]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
clean: false
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install python3-pip python3-setuptools
sudo pip3 install robotframework
# install custom theme
sudo cp -r theme/rebot/ /usr/local/lib/python3.10/dist-packages/robot/htmldata/
- name: Download test output
uses: actions/download-artifact@v4
- name: Create report
run: |
mv output-*/*.xml .
scripts/build_and_run --gen-report
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: report
path: |
report.html
log.html
- name: Checkout GH Pages branch
if: github.ref == 'refs/heads/main'
uses: actions/checkout@v4
with:
ref: gh-pages
fetch-depth: 0
path: gh-pages
- name: Deploy to GH Pages
if: github.ref == 'refs/heads/main'
run: |
mv -f report.html gh-pages/index.html
mv -f log.html gh-pages
cd gh-pages
touch .nojekyll
git add *.html
git config --local user.email "push@gha"
git config --local user.name "GHA"
git commit -m "update ${{ github.sha }}" --allow-empty
git push -u origin gh-pages