-
Notifications
You must be signed in to change notification settings - Fork 175
149 lines (143 loc) · 4.18 KB
/
main.yaml
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
on:
push:
pull_request:
merge_group:
name: CI
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- '3.12'
- 'pypy-3.8'
- 'pypy-3.9'
- 'pypy-3.10'
allow-failure:
- false
include:
- python-version: '3.13-dev'
allow-failure: true
continue-on-error: '${{ matrix.allow-failure }}'
name: 'test (${{ matrix.python-version }})'
steps:
- name: Check out source code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys FA8E1301F4D3932C
sudo add-apt-repository 'deb http://ppa.launchpad.net/sri-csl/formal-methods/ubuntu bionic main'
sudo apt-get update
sudo apt-get install yices2
pip install codecov
pdm install --dev
- name: Cache YoWASP build products
uses: actions/cache@v3
with:
path: ~/.cache/YoWASP
key: YoWASP-${{ runner.os }}-${{ hashFiles('./.venv/**/*.wasm') }}
restore-keys: |
YoWASP-${{ runner.os }}-
- name: Run tests
run: |
pdm run test
- name: Submit code coverage
run:
codecov
document:
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fetch tags from upstream repository
run: |
git fetch --tags https://github.com/amaranth-lang/amaranth.git
- name: Set up PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: '3.11'
- name: Install dependencies
run: |
pdm install --dev
- name: Build documentation
run: |
pdm run document
- name: Upload documentation archive
uses: actions/upload-artifact@v3
with:
name: docs
path: docs/_build
required: # group all required workflows into one for the required status check
needs:
- test
- document
runs-on: ubuntu-latest
steps:
- run: |
true
publish-docs:
needs: document
if: github.repository == 'amaranth-lang/amaranth'
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Download documentation archive
uses: actions/download-artifact@v3
with:
name: docs
path: docs/
- name: Publish development documentation
if: github.event_name == 'push' && github.event.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
repository-name: amaranth-lang/amaranth-lang.github.io
ssh-key: ${{ secrets.PAGES_DEPLOY_KEY }}
branch: main
folder: docs/
target-folder: docs/amaranth/latest/
- name: Publish release documentation
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
repository-name: amaranth-lang/amaranth-lang.github.io
ssh-key: ${{ secrets.PAGES_DEPLOY_KEY }}
branch: main
folder: docs/
target-folder: docs/amaranth/${{ github.ref_name }}/
publish-docs-dev:
needs: document
if: github.repository != 'amaranth-lang/amaranth'
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Download documentation archive
uses: actions/download-artifact@v3
with:
name: docs
path: pages/docs/${{ github.ref_name }}/
- name: Disable Jekyll
run: |
touch pages/.nojekyll
- name: Publish documentation for a branch
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
folder: pages/
clean: false