-
Notifications
You must be signed in to change notification settings - Fork 29
207 lines (198 loc) · 5.83 KB
/
ci.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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# Copyright 2022 ETH Zurich and University of Bologna.
# Solderpad Hardware License, Version 0.51, see LICENSE for details.
# SPDX-License-Identifier: SHL-0.51
# Author: Michael Rogenmoser <[email protected]>
name: ci
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
env:
BENDER: ./bender
jobs:
check-clean:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'
- name: Install Bender
run: make bender
- name: Python Requirements
run: pip install -r requirements.txt
- name: Check clean make targets
run: |
make -B prepare_sim gen_ci gen_regs
make clean
git status && test -z "$(git status --porcelain)"
check-stale:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'
- name: Install Bender
run: make bender
- name: Python Requirements
run: pip install -r requirements.txt
- name: Check clean makefile
run: |
make -B prepare_sim gen_ci gen_regs
git status && test -z "$(git status --porcelain)"
lint:
runs-on: ubuntu-latest
needs: [check-clean, check-stale]
strategy:
fail-fast: false
matrix:
lint_check: [license, python]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'
- name: Python Requirements
run: python3 -m pip install -r requirements.txt
- name: Install Bender
run: make bender
- name: Lint license
if: ${{ matrix.lint_check == 'license' }}
run: scripts/check-license
- name: Lint python
if: ${{ matrix.lint_check == 'python' }}
run: scripts/python-lint
lint-commit:
runs-on: ubuntu-latest
needs: [check-clean, check-stale]
steps:
- uses: actions/checkout@v3
if: ${{ github.event_name == 'push' }}
- uses: actions/checkout@v3
if: ${{ github.event_name == 'pull_request' }}
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'
- name: Python Requirements
run: python3 -m pip install -r requirements.txt
- name: Lint commits
run: python3 util/lint-commits.py HEAD
lint-verilog:
runs-on: ubuntu-latest
needs: [check-clean, check-stale]
steps:
- uses: actions/checkout@v3
- uses: chipsalliance/verible-linter-action@main
with:
paths: |
./src
exclude_paths: |
./src/test
./src/systems/idma_axi_to_mem.sv
extra_args: "--rules=-interface-name-style --lint_fatal --parse_fatal --waiver_files util/waiver.verible"
github_token: ${{ secrets.GITHUB_TOKEN }}
reviewdog_reporter: github-check
analyze-contributors:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'
- name: Python Requirements
run: pip install -r requirements.txt
- name: List contributors
run: scripts/list-contributors | tee contributions.txt
- name: Upload contributions.txt
uses: actions/upload-artifact@v2
with:
name: contributions
path: contributions.txt
retention-days: 7
analyze-todos:
runs-on: ubuntu-latest
needs: lint
continue-on-error: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'
- name: Python Requirements
run: pip install -r requirements.txt
- name: List todos
run: scripts/list-todos | tee open_todos.txt
- name: Upload todos.txt
uses: actions/upload-artifact@v2
with:
name: open_todos
path: open_todos.txt
retention-days: 7
docs:
runs-on: ubuntu-22.04
needs: [lint, lint-verilog]
env:
MORTY: ./morty
steps:
- uses: actions/checkout@v3
- name: Install Bender
run: make bender
- uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'
- name: Python Requirements
run: python3 -m pip install -r requirements.txt
- name: Install Morty
run: |
curl --proto '=https' --tlsv1.2 -sLO https://github.com/pulp-platform/morty/releases/download/v0.7.0/morty-ubuntu.22.04-x86_64.tar.gz
tar -xvf morty-ubuntu.22.04-x86_64.tar.gz morty
rm -f morty-ubuntu.22.04-x86_64.tar.gz
cp morty doc
- name: Build Doc
run: make doc
- name: Pickle
run: make -B pickle
- name: Upload doc
uses: actions/upload-artifact@v2
with:
name: doc
path: doc/build
retention-days: 7
- name: Upload pickle
uses: actions/upload-artifact@v2
with:
name: pickle
path: pickle
retention-days: 7
- name: Create publish docs
if: ${{ github.event_name == 'push' }}
uses: actions/upload-pages-artifact@main
with:
path: doc/build/html
deploy-pages:
needs: docs
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.output.page_url }}
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
steps:
- name: Deploy to Github Pages
id: deployment
uses: actions/deploy-pages@v1