Add CI configuration #2
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
name: CI config | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
create_venv: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: venv | |
key: v0-dependencies-${{ hashFiles('pyproject.toml') }} | |
restore-keys: | | |
v0-dependencies- | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Create virtual environment | |
run: make venv | |
- name: Save venv for later runs | |
uses: actions/upload-artifact@v2 | |
with: | |
name: venv | |
path: venv | |
check_format: | |
needs: create_venv | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Attach venv from previous job | |
uses: actions/download-artifact@v2 | |
with: | |
name: venv | |
- name: Run format check | |
run: make check_format | |
lint: | |
needs: create_venv | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Attach venv from previous job | |
uses: actions/download-artifact@v2 | |
with: | |
name: venv | |
- name: Run linting | |
run: make lint | |
- name: Store test results | |
uses: actions/upload-artifact@v2 | |
with: | |
name: test_results | |
path: test_results | |
installable: | |
needs: create_venv | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Attach venv from previous job | |
uses: actions/download-artifact@v2 | |
with: | |
name: venv | |
- name: Run installable check | |
run: make installable | |
test_coverage: | |
needs: create_venv | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Attach venv from previous job | |
uses: actions/download-artifact@v2 | |
with: | |
name: venv | |
- name: Install rsync | |
run: sudo apt-get install rsync | |
- name: Run test coverage | |
run: make test_coverage | |
- name: Store test results | |
uses: actions/upload-artifact@v2 | |
with: | |
name: test_results | |
path: test_results | |
- name: Store coverage HTML | |
uses: actions/upload-artifact@v2 | |
with: | |
name: coverage_html | |
path: test_results/coverage_html | |