Update dependency bandit to v1.8.0 #2837
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: Test | |
on: | |
pull_request: | |
types: | |
- "opened" | |
- "synchronize" | |
push: | |
branches: | |
- "main" | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
id: setup-python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: cache poetry install | |
uses: actions/cache@v4 | |
with: | |
path: ~/.local | |
key: poetry-${{ steps.setup-python.outputs.python-version }}-1.7.1-0 | |
- uses: snok/install-poetry@v1 | |
with: | |
version: 1.7.1 | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v4 | |
with: | |
path: .venv | |
key: venv-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-0 | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: poetry install --no-interaction --extras all | |
- name: Set up MongoDB | |
uses: supercharge/[email protected] | |
- name: Run unit tests | |
run: poetry run -- nox -- tests --cov-report=xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: 87321f4c-b660-4e02-9fd8-265874583eb3 | |
fail_ci_if_error: true | |
file: ./coverage.xml | |
verbose: true | |
lint: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
id: setup-python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: cache poetry install | |
uses: actions/cache@v4 | |
with: | |
path: ~/.local | |
key: poetry-${{ steps.setup-python.outputs.python-version }}-1.7.1-0 | |
- uses: snok/install-poetry@v1 | |
with: | |
version: 1.7.1 | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v4 | |
with: | |
path: .venv | |
key: venv-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-0 | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: poetry install --no-interaction --extras all | |
- name: Run pre-commit | |
run: | | |
source .venv/bin/activate | |
pre-commit run --all-files |