chore: Update dependencies across the board (#37) #81
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 | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
types: | |
- opened | |
- synchronize | |
jobs: | |
create-venv: | |
name: Setup | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v1 | |
with: | |
fetch-depth: 1 | |
- name: Set up Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.9 | |
- name: Install Poetry | |
uses: snok/[email protected] | |
with: | |
virtualenvs-create: false | |
virtualenvs-in-project: true | |
- name: Restore cached venv | |
uses: syphar/restore-virtualenv@v1 | |
id: cache-venv | |
with: | |
requirements_files: poetry.lock | |
# need to set this to manually bust the cache | |
custom_cache_key_element: v2 | |
- name: Restore Pip download cache | |
uses: syphar/restore-pip-download-cache@v1 | |
if: steps.cache-venv.outputs.cache-hit != 'true' | |
- name: Install Python dependencies | |
if: steps.cache-venv.outputs.cache-hit != 'true' | |
run: make python-install-deps PY_INSTALL_ARGS="--extras=all" | |
lint: | |
name: Lint | |
needs: create-venv | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v1 | |
with: | |
fetch-depth: 1 | |
- name: Set up Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.9 | |
- name: Install Poetry | |
uses: snok/[email protected] | |
with: | |
virtualenvs-create: false | |
virtualenvs-in-project: true | |
- name: Restore cached venv | |
uses: syphar/restore-virtualenv@v1 | |
id: cache-venv | |
- name: Run linting tools | |
run: make lint lint-docs | |
build: | |
name: Build | |
needs: create-venv | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v1 | |
with: | |
fetch-depth: 1 | |
- name: Set up Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.9 | |
- name: Install Poetry | |
uses: snok/[email protected] | |
with: | |
virtualenvs-create: false | |
virtualenvs-in-project: true | |
- name: Restore cache venv | |
uses: syphar/restore-virtualenv@v1 | |
id: cache-venv | |
- name: Build package | |
run: make build | |
test: | |
name: Test | |
needs: create-venv | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v1 | |
with: | |
fetch-depth: 1 | |
- name: Set up Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.9 | |
- name: Install Poetry | |
uses: snok/[email protected] | |
with: | |
virtualenvs-create: false | |
virtualenvs-in-project: true | |
- name: Restore cache venv | |
uses: syphar/restore-virtualenv@v1 | |
id: cache-venv | |
- name: Run tests | |
run: make test | |
analyze: | |
name: Analyze | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
contents: read | |
security-events: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
- name: Set up python | |
id: setup-python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v2 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: make python-install-deps | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v2 | |
with: | |
languages: python | |
setup-python-dependencies: false | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v2 |