Update flake.lock #891
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: | |
- master | |
pull_request: | |
branches: | |
- master | |
env: | |
POETRY_HOME: /tmp/poetry | |
POETRY_CONFIG_DIR: /tmp/poetry | |
POETRY_VIRTUALENVS_PATH: /tmp/poetry/store | |
DEFAULT_PYTHON: '3.10' | |
jobs: | |
# This job checks if an identical workflow is being triggered by different | |
# event and skips it. For instance there is no need to run the same pipeline | |
# twice for pull_request and push for identical commit sha. | |
pre_job: | |
runs-on: ubuntu-latest | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
- id: skip_check | |
uses: fkirc/[email protected] | |
with: | |
skip_after_successful_duplicate: 'true' | |
concurrent_skipping: same_content | |
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]' | |
install: | |
needs: pre_job | |
if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | |
strategy: | |
matrix: | |
python-version: [ '3.8', '3.9', '3.10', '3.11' ] | |
os: [ubuntu-latest, macos-12] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Init Poetry cache | |
id: cached-poetry | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.POETRY_HOME }} | |
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('./pyproject.toml') }}-${{ hashFiles('./poetry.lock') }} | |
- name: Install package | |
run: make install | |
if: steps.cached-poetry.outputs.cache-hit != 'true' | |
build: | |
needs: install | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ env.DEFAULT_PYTHON }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.DEFAULT_PYTHON }} | |
- name: Load Poetry cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.POETRY_HOME }} | |
key: ${{ runner.os }}-${{ env.DEFAULT_PYTHON }}-${{ hashFiles('./pyproject.toml') }}-${{ hashFiles('./poetry.lock') }} | |
- name: Build wheel | |
run: make build | |
- name: Archive build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ format('fastapi_mvc-{0}', github.sha) }} | |
path: dist | |
retention-days: 60 | |
coverage: | |
needs: install | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ env.DEFAULT_PYTHON }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.DEFAULT_PYTHON }} | |
- name: Load Poetry cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.POETRY_HOME }} | |
key: ${{ runner.os }}-${{ env.DEFAULT_PYTHON }}-${{ hashFiles('./pyproject.toml') }}-${{ hashFiles('./poetry.lock') }} | |
- name: Run fastapi-mvc coverage | |
run: make coverage | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
fail_ci_if_error: true | |
files: ./coverage.xml | |
metrics: | |
needs: install | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ env.DEFAULT_PYTHON }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.DEFAULT_PYTHON }} | |
- name: Load Poetry cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.POETRY_HOME }} | |
key: ${{ runner.os }}-${{ env.DEFAULT_PYTHON }}-${{ hashFiles('./pyproject.toml') }}-${{ hashFiles('./poetry.lock') }} | |
- name: Run metrics checks | |
run: make metrics | |
mypy: | |
needs: install | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ env.DEFAULT_PYTHON }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.DEFAULT_PYTHON }} | |
- name: Load Poetry cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.POETRY_HOME }} | |
key: ${{ runner.os }}-${{ env.DEFAULT_PYTHON }}-${{ hashFiles('./pyproject.toml') }}-${{ hashFiles('./poetry.lock') }} | |
- name: Run mypy checks | |
run: make mypy | |
unit-tests: | |
needs: install | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [ '3.8', '3.9', '3.10', '3.11' ] | |
os: [ubuntu-latest, macos-12] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Load Poetry cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.POETRY_HOME }} | |
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('./pyproject.toml') }}-${{ hashFiles('./poetry.lock') }} | |
- name: Run unit tests | |
run: make unit-test | |
integration-tests: | |
needs: install | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [ '3.8', '3.9', '3.10', '3.11' ] | |
os: [ubuntu-latest, macos-12] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up GNU coreutils on macos runner | |
if: matrix.os == 'macos-12' | |
run: | | |
brew install coreutils | |
echo "/usr/local/opt/coreutils/libexec/gnubin" >> $GITHUB_PATH | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Load Poetry cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.POETRY_HOME }} | |
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('./pyproject.toml') }}-${{ hashFiles('./poetry.lock') }} | |
- name: Run integration tests | |
run: make integration-test |