-
Notifications
You must be signed in to change notification settings - Fork 6
164 lines (143 loc) · 4.23 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
158
159
160
161
162
163
164
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@v2
with:
submodules: recursive
fetch-depth: 0
clean: false
- name: Make build matrix
id: make_matrix
run: echo "::set-output name=matrix::$(ls verilator | jq -R -s -c 'split("\n")[:-1]')"
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@v2
with:
submodules: recursive
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 pip3 install pyyaml
sudo pip3 install jinja2
sudo pip3 install robotframework
- name: Cache $CCACHE_DIR
uses: actions/cache@v2
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ matrix.VERILATOR_BRANCH }}
- name: Build Verilator
working-directory: verilator/${{ matrix.VERILATOR_BRANCH }}
env:
CC: gcc-11
CXX: g++-11
run: |
git show -q
autoconf
./configure
make -j$(nproc)
- name: Generate Robot test files
run: ./gen-tests ${{ matrix.VERILATOR_BRANCH }}
- name: Run tests
run: |
for TEST_SUITE_FILE in $(ls *.robot); do
TEST_SUITE="${TEST_SUITE_FILE%.*}"
robot --report NONE --log NONE \
--output $TEST_SUITE.xml \
$TEST_SUITE_FILE || \
[ $? -lt 252 ] # exit code >= 252 means internal Robot error
done
- name: Upload test output
uses: actions/upload-artifact@v3
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@v2
with:
submodules: recursive
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: Checkout
uses: actions/checkout@v2
with:
ref: gh-pages
fetch-depth: 0
clean: false
- name: Download test output
uses: actions/download-artifact@v2
- name: Create report
run: |
rebot --name "Verification Features" output-*/*.xml || \
[ $? -lt 252 ] # exit code >= 252 means internal Robot error
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: report
path: |
report.html
log.html
- name: Deploy to GH Pages
if: github.ref == 'refs/heads/main'
run: |
touch .nojekyll
cp report.html index.html
git add *.html
git config --local user.email "push@gha"
git config --local user.name "GHA"
git commit -am "update ${{ github.sha }}"
git push -u origin gh-pages