-
Notifications
You must be signed in to change notification settings - Fork 4
105 lines (103 loc) · 2.84 KB
/
test_publish.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
name: python testsuite and deploy
on: [push, pull_request]
jobs:
run_testsuite:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Setup PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: '3.10'
- name: Install solver
run: |
sudo add-apt-repository ppa:sri-csl/formal-methods
sudo apt-get update
sudo apt-get install yices2
- name: Install dependencies
run: pdm install -G test -G ci_test
- name: Run test suite
run:
SMTBMC=yowasp-yosys-smtbmc SBY=yowasp-sby YOSYS=yowasp-yosys pdm test
publish_pypi:
if: github.ref == 'refs/heads/main'
needs:
- run_testsuite
- publish_docs
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Setup PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: '3.10'
- name: Install deps
run: |
pdm install -G publish
- name: Build package
env:
DOC_SHA: ${{ needs.publish_docs.outputs.doc_sha }}
run: |
pdm build
- name: Upload to pypi
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
TWINE_NON_INTERACTIVE: 1
run: |
twine upload dist/naps*
- name: upload
if: failure()
uses: actions/upload-artifact@v2
with:
name: sdist
path: dist/*
publish_docs:
if: github.ref == 'refs/heads/main'
needs: run_testsuite
runs-on: ubuntu-latest
outputs:
doc_sha: ${{ steps.pages.outputs.dst_sha }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Setup PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: '3.10'
- name: Install deps
run: |
pdm install -G doc
- name: Run sphinx autodoc
run: |
pdm run sphinx-apidoc -o doc naps
- name: Build docs
run: |
make -C doc html
- name: Deploy
id: pages
uses: peaceiris/actions-gh-pages@7e55c73ee896b01b8b8668370794b96f1bc9c759 #514
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./doc/_build/html
allow_empty_commit: true
- name: Update docs server
run: |
curl ${{ secrets.DOCS_UPDATE_HOOK }}