CI #826
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: [push, pull_request, merge_group] | |
name: CI | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: | |
- '3.7' | |
- '3.8' | |
- '3.9' | |
- '3.10' | |
- '3.11' | |
- 'pypy-3.7-v7.3.3' | |
allow-failure: | |
- false | |
include: | |
- python-version: '3.12-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 Python | |
uses: actions/setup-python@v4 | |
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 coverage codecov | |
pip install yowasp-yosys==0.20.* # last version compatible with Python 3.7 | |
pip install -e .[builtin-yosys] | |
pip install -r docs/requirements.txt | |
- name: Preserve Wasm cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/wasmtime | |
~/.cache/yowasp | |
key: ${{ runner.os }}-wasm | |
- name: Run tests | |
run: | | |
export AMARANTH_USE_YOSYS=builtin YOSYS=yowasp-yosys SBY=yowasp-sby SMTBMC=yowasp-yosys-smtbmc | |
export PYTHONWARNINGS=error | |
python -m coverage run -m unittest discover -t . -s tests | |
unset PYTHONWARNINGS | |
sphinx-build -b doctest docs/ docs/_build | |
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 Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
pip install -r docs/requirements.txt | |
pip install . | |
- name: Build documentation | |
run: | | |
sphinx-build docs docs/_build | |
- name: Upload documentation archive | |
uses: actions/upload-artifact@v3 | |
with: | |
name: docs | |
path: docs/_build | |
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 |