CI: fix code coverage collection.
[nmigen.git] / .github / workflows / main.yaml
1 on:
2 push: {}
3 pull_request:
4 types: [opened, reopened, synchronize]
5 name: CI
6 jobs:
7 test:
8 runs-on: ubuntu-latest
9 strategy:
10 matrix:
11 python-version: ['3.6', '3.7', '3.8', pypy3]
12 steps:
13 - name: Check out source code
14 uses: actions/checkout@v2
15 with:
16 fetch-depth: 0
17 - name: Set up Python
18 uses: actions/setup-python@v2
19 with:
20 python-version: ${{ matrix.python-version }}
21 - name: Install dependencies
22 run: |
23 sudo add-apt-repository ppa:sri-csl/formal-methods
24 sudo apt-get update
25 sudo apt-get install yices2
26 pip install setuptools setuptools_scm wheel coverage codecov yowasp-yosys nmigen-yosys
27 pip install -e .
28 - name: Preserve wasmtime cache
29 uses: actions/cache@v1
30 with:
31 path: ~/.cache/wasmtime
32 key: ${{ runner.os }}-wasmtime
33 - name: Run tests
34 run: |
35 export NMIGEN_USE_YOSYS=builtin YOSYS=yowasp-yosys SBY=yowasp-sby SMTBMC=yowasp-yosys-smtbmc
36 python -m coverage run -m unittest
37 codecov
38 document:
39 runs-on: ubuntu-latest
40 steps:
41 - name: Check out source code
42 uses: actions/checkout@v2
43 with:
44 fetch-depth: 0
45 - name: Set up Python
46 uses: actions/setup-python@v2
47 - name: Install dependencies
48 run: |
49 python -m pip install --upgrade setuptools setuptools_scm wheel
50 pip install -r docs/requirements.txt
51 pip install -e .
52 - name: Build documentation
53 run: |
54 sphinx-build docs docs/_build
55 - name: Publish documentation
56 if: github.event_name == 'push' && github.event.ref == 'refs/heads/master'
57 uses: JamesIves/github-pages-deploy-action@releases/v3
58 with:
59 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60 BRANCH: gh-pages
61 FOLDER: docs/_build
62 TARGET_FOLDER: latest/