@@ -24,15 +24,15 @@ jobs:
24
24
include :
25
25
- python-version : ' 3.13-dev'
26
26
allow-failure : true
27
- continue-on-error : ' ${{ matrix.allow-failure }}'
27
+ continue-on-error : ${{ matrix.allow-failure }}
28
28
name : ' test (${{ matrix.python-version }})'
29
29
steps :
30
30
- name : Check out source code
31
- uses : actions/checkout@v3
31
+ uses : actions/checkout@v4
32
32
with :
33
33
fetch-depth : 0
34
34
- name : Set up PDM
35
- uses : pdm-project/setup-pdm@v3
35
+ uses : pdm-project/setup-pdm@v4
36
36
with :
37
37
python-version : ${{ matrix.python-version }}
38
38
- name : Install dependencies
@@ -41,10 +41,10 @@ jobs:
41
41
sudo add-apt-repository 'deb http://ppa.launchpad.net/sri-csl/formal-methods/ubuntu bionic main'
42
42
sudo apt-get update
43
43
sudo apt-get install yices2
44
- pip install codecov
44
+ pip install codecov build
45
45
pdm install --dev
46
46
- name : Cache YoWASP build products
47
- uses : actions/cache@v3
47
+ uses : actions/cache@v4
48
48
with :
49
49
path : ~/.cache/YoWASP
50
50
key : YoWASP-${{ runner.os }}-${{ hashFiles('./.venv/**/*.wasm') }}
@@ -54,21 +54,65 @@ jobs:
54
54
run : |
55
55
pdm run test
56
56
- name : Submit code coverage
57
- run :
57
+ run : |
58
58
codecov
59
59
60
+ smoketest : # If we plug this into downstream projects, does magic smoke escape?
61
+ runs-on : ubuntu-latest
62
+ strategy :
63
+ fail-fast : false
64
+ matrix :
65
+ project :
66
+ - amaranth-lang/amaranth-boards
67
+ - amaranth-lang/amaranth-stdio
68
+ - amaranth-lang/amaranth-soc
69
+ name : ' smoke (${{ matrix.project }})'
70
+ steps :
71
+ - name : Check out Amaranth source code
72
+ uses : actions/checkout@v4
73
+ with :
74
+ path : amaranth
75
+ fetch-depth : 0
76
+ - name : Check out source code
77
+ uses : actions/checkout@v4
78
+ with :
79
+ repository : ${{ matrix.project }}
80
+ path : project
81
+ fetch-depth : 0
82
+ - name : Set up PDM
83
+ uses : pdm-project/setup-pdm@v4
84
+ - name : Install dependencies
85
+ working-directory : project
86
+ run : |
87
+ pdm install --dev
88
+ - name : Use Amaranth HEAD revision
89
+ working-directory : project
90
+ run : |
91
+ pdm add ../amaranth
92
+ - name : Cache YoWASP build products
93
+ uses : actions/cache@v4
94
+ with :
95
+ path : ~/.cache/YoWASP
96
+ key : YoWASP-${{ runner.os }}-${{ hashFiles('./.venv/**/*.wasm') }}
97
+ restore-keys : |
98
+ YoWASP-${{ runner.os }}-
99
+ - name : Run tests
100
+ working-directory : project
101
+ run : |
102
+ pdm run test
103
+
60
104
document :
61
105
runs-on : ubuntu-latest
62
106
steps :
63
107
- name : Check out source code
64
- uses : actions/checkout@v3
108
+ uses : actions/checkout@v4
65
109
with :
66
110
fetch-depth : 0
67
111
- name : Fetch tags from upstream repository
68
112
run : |
69
113
git fetch --tags https://github.com/amaranth-lang/amaranth.git
70
114
- name : Set up PDM
71
- uses : pdm-project/setup-pdm@v3
115
+ uses : pdm-project/setup-pdm@v4
72
116
with :
73
117
python-version : ' 3.12'
74
118
- name : Install dependencies
@@ -78,36 +122,52 @@ jobs:
78
122
run : |
79
123
pdm run document
80
124
- name : Upload documentation archive
81
- uses : actions/upload-artifact@v3
125
+ uses : actions/upload-artifact@v4
82
126
with :
83
127
name : docs
84
128
path : docs/_build
85
129
130
+ check-links :
131
+ runs-on : ubuntu-latest
132
+ steps :
133
+ - name : Check out source code
134
+ uses : actions/checkout@v4
135
+ - name : Set up PDM
136
+ uses : pdm-project/setup-pdm@v4
137
+ with :
138
+ python-version : ' 3.12'
139
+ - name : Install dependencies
140
+ run : |
141
+ pdm install --dev
142
+ - name : Check links in documentation
143
+ run : |
144
+ pdm run document-linkcheck
145
+
86
146
required : # group all required workflows into one to avoid reconfiguring this in Actions settings
87
147
needs :
88
148
- test
89
149
- document
90
- if : always() && !contains(needs.*.result, 'cancelled')
150
+ if : ${{ always() && !contains(needs.*.result, 'cancelled') }}
91
151
runs-on : ubuntu-latest
92
152
steps :
93
153
- run : ${{ contains(needs.*.result, 'failure') && 'false' || 'true' }}
94
154
95
155
publish-docs :
96
156
needs : document
97
- if : github.repository == 'amaranth-lang/amaranth'
157
+ if : ${{ github.repository == 'amaranth-lang/amaranth' }}
98
158
runs-on : ubuntu-latest
99
159
steps :
100
160
- name : Check out source code
101
- uses : actions/checkout@v3
161
+ uses : actions/checkout@v4
102
162
with :
103
163
fetch-depth : 0
104
164
- name : Download documentation archive
105
- uses : actions/download-artifact@v3
165
+ uses : actions/download-artifact@v4
106
166
with :
107
167
name : docs
108
168
path : docs/
109
169
- name : Publish development documentation
110
- if : github.event_name == 'push' && github.event.ref == 'refs/heads/main'
170
+ if : ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }}
111
171
uses : JamesIves/github-pages-deploy-action@releases/v4
112
172
with :
113
173
repository-name : amaranth-lang/amaranth-lang.github.io
@@ -116,7 +176,7 @@ jobs:
116
176
folder : docs/
117
177
target-folder : docs/amaranth/latest/
118
178
- name : Publish release documentation
119
- if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
179
+ if : ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') }}
120
180
uses : JamesIves/github-pages-deploy-action@releases/v4
121
181
with :
122
182
repository-name : amaranth-lang/amaranth-lang.github.io
@@ -127,15 +187,15 @@ jobs:
127
187
128
188
publish-docs-dev :
129
189
needs : document
130
- if : github.repository != 'amaranth-lang/amaranth'
190
+ if : ${{ github.repository != 'amaranth-lang/amaranth' }}
131
191
runs-on : ubuntu-latest
132
192
steps :
133
193
- name : Check out source code
134
- uses : actions/checkout@v3
194
+ uses : actions/checkout@v4
135
195
with :
136
196
fetch-depth : 0
137
197
- name : Download documentation archive
138
- uses : actions/download-artifact@v3
198
+ uses : actions/download-artifact@v4
139
199
with :
140
200
name : docs
141
201
path : pages/docs/${{ github.ref_name }}/
@@ -147,3 +207,57 @@ jobs:
147
207
with :
148
208
folder : pages/
149
209
clean : false
210
+
211
+ publish-package :
212
+ needs : required
213
+ runs-on : ubuntu-latest
214
+ environment : publish
215
+ permissions :
216
+ id-token : write
217
+ steps :
218
+ - name : Check out source code
219
+ uses : actions/checkout@v4
220
+ with :
221
+ fetch-depth : 0
222
+ - name : Build package
223
+ run : |
224
+ pip install build
225
+ python -m build
226
+ - name : Upload package artifact
227
+ uses : actions/upload-artifact@v4
228
+ with :
229
+ name : package
230
+ path : dist/
231
+ - name : Verify package metadata
232
+ run : |
233
+ pip install twine
234
+ twine check dist/*
235
+ - name : Publish package to Test PyPI
236
+ if : ${{ github.repository == 'amaranth-lang/amaranth' && github.event_name == 'push' && github.event.ref == 'refs/heads/main' }}
237
+ uses : pypa/gh-action-pypi-publish@release/v1
238
+ with :
239
+ repository-url : https://test.pypi.org/legacy/
240
+ - name : Publish package to PyPI
241
+ if : ${{ github.repository == 'amaranth-lang/amaranth' && github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') }}
242
+ uses : pypa/gh-action-pypi-publish@release/v1
243
+
244
+ publish-release :
245
+ needs : publish-package
246
+ if : ${{ github.repository == 'amaranth-lang/amaranth' && github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') }}
247
+ runs-on : ubuntu-latest
248
+ permissions :
249
+ contents : write
250
+ steps :
251
+ - name : Determine release metadata
252
+ id : metadata
253
+ env :
254
+ REF_NAME : ${{ github.ref_name }}
255
+ run : |
256
+ echo name=${REF_NAME/v/} >>$GITHUB_OUTPUT
257
+ - name : Create release
258
+ uses : comnoco/create-release-action@v2
259
+ env :
260
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
261
+ with :
262
+ tag_name : ${{ github.ref_name }}
263
+ release_name : ${{ steps.metadata.outputs.name }}
0 commit comments