@@ -13,10 +13,20 @@ jobs:
13
13
matrix :
14
14
python-version :
15
15
- ' 3.8'
16
+ - ' 3.9'
17
+ - ' 3.10'
18
+ - ' 3.11'
19
+ - ' 3.12'
20
+ - ' pypy-3.8'
21
+ - ' pypy-3.9'
22
+ - ' pypy-3.10'
16
23
# this version range needs to be synchronized with the one in pyproject.toml
17
24
amaranth-version :
18
25
- ' git'
19
- fail-fast : false
26
+ allow-failure :
27
+ - false
28
+ continue-on-error : ' ${{ matrix.allow-failure }}'
29
+ name : ' test (${{ matrix.python-version }}, HDL ${{ matrix.amaranth-version }})'
20
30
steps :
21
31
- name : Check out source code
22
32
uses : actions/checkout@v3
@@ -45,10 +55,93 @@ jobs:
45
55
run :
46
56
codecov
47
57
48
- required : # group all required workflows into one for the required status check
58
+ document :
59
+ runs-on : ubuntu-latest
60
+ steps :
61
+ - name : Check out source code
62
+ uses : actions/checkout@v3
63
+ with :
64
+ fetch-depth : 0
65
+ - name : Fetch tags from upstream repository
66
+ run : |
67
+ git fetch --tags https://github.com/amaranth-lang/amaranth-soc.git
68
+ - name : Set up PDM
69
+ uses : pdm-project/setup-pdm@v3
70
+ with :
71
+ python-version : ' 3.12'
72
+ - name : Install dependencies
73
+ run : |
74
+ pdm install --dev
75
+ - name : Build documentation
76
+ run : |
77
+ pdm run document
78
+ - name : Upload documentation archive
79
+ uses : actions/upload-artifact@v3
80
+ with :
81
+ name : docs
82
+ path : docs/_build
83
+
84
+ required : # group all required workflows into one to avoid reconfiguring this in Actions settings
49
85
needs :
50
86
- test
87
+ - document
88
+ if : always() && !contains(needs.*.result, 'cancelled')
89
+ runs-on : ubuntu-latest
90
+ steps :
91
+ - run : ${{ contains(needs.*.result, 'failure') && 'false' || 'true' }}
92
+
93
+ publish-docs :
94
+ needs : document
95
+ if : github.repository == 'amaranth-lang/amaranth-soc'
96
+ runs-on : ubuntu-latest
97
+ steps :
98
+ - name : Check out source code
99
+ uses : actions/checkout@v3
100
+ with :
101
+ fetch-depth : 0
102
+ - name : Download documentation archive
103
+ uses : actions/download-artifact@v3
104
+ with :
105
+ name : docs
106
+ path : docs/
107
+ - name : Publish development documentation
108
+ if : github.event_name == 'push' && github.event.ref == 'refs/heads/main'
109
+ uses : JamesIves/github-pages-deploy-action@releases/v4
110
+ with :
111
+ repository-name : amaranth-lang/amaranth-lang.github.io
112
+ ssh-key : ${{ secrets.PAGES_DEPLOY_KEY }}
113
+ branch : main
114
+ folder : docs/
115
+ target-folder : docs/amaranth-soc/latest/
116
+ - name : Publish release documentation
117
+ if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
118
+ uses : JamesIves/github-pages-deploy-action@releases/v4
119
+ with :
120
+ repository-name : amaranth-lang/amaranth-lang.github.io
121
+ ssh-key : ${{ secrets.PAGES_DEPLOY_KEY }}
122
+ branch : main
123
+ folder : docs/
124
+ target-folder : docs/amaranth-soc/${{ github.ref_name }}/
125
+
126
+ publish-docs-dev :
127
+ needs : document
128
+ if : github.repository != 'amaranth-lang/amaranth-soc'
51
129
runs-on : ubuntu-latest
52
130
steps :
53
- - run : |
54
- true
131
+ - name : Check out source code
132
+ uses : actions/checkout@v3
133
+ with :
134
+ fetch-depth : 0
135
+ - name : Download documentation archive
136
+ uses : actions/download-artifact@v3
137
+ with :
138
+ name : docs
139
+ path : pages/docs/${{ github.ref_name }}/
140
+ - name : Disable Jekyll
141
+ run : |
142
+ touch pages/.nojekyll
143
+ - name : Publish documentation for a branch
144
+ uses : JamesIves/github-pages-deploy-action@releases/v4
145
+ with :
146
+ folder : pages/
147
+ clean : false
0 commit comments