Solsis API #319
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: Check Backend | |
on: | |
push: | |
paths: | |
- .github/workflows/api.yaml | |
- API/** | |
branches: | |
- main | |
pull_request: | |
paths: | |
- .github/workflows/api.yaml | |
- API/** | |
defaults: | |
run: | |
working-directory: API | |
shell: bash | |
jobs: | |
lint: | |
name: Linting | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Configure Poetry cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/black | |
~/.cache/pip | |
~/.cache/pypoetry | |
~/.local/share/pypoetry | |
~/.local/bin/poetry | |
./.ruff_cache | |
key: ${{ runner.os }}-poetry-lint-${{ hashFiles('**/poetry.lock') }} | |
restore-keys: ${{ runner.os }}-poetry-lint- | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python - | |
~/.local/bin/poetry config virtualenvs.create false | |
echo "~/.local/bin" >> $GITHUB_PATH | |
- name: Install dependencies | |
run: poetry install --extras sentry | |
- name: Lint the project with ruff | |
run: ruff gimvicurnik | |
- name: Lint the project with black | |
run: black gimvicurnik --check | |
typecheck: | |
name: Typechecking | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Configure Poetry cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/pip | |
~/.cache/pypoetry | |
~/.local/share/pypoetry | |
~/.local/bin/poetry | |
./.mypy_cache | |
key: ${{ runner.os }}-poetry-typecheck-${{ hashFiles('**/poetry.lock') }} | |
restore-keys: ${{ runner.os }}-poetry-typecheck- | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python - | |
~/.local/bin/poetry config virtualenvs.create false | |
echo "~/.local/bin" >> $GITHUB_PATH | |
- name: Install dependencies | |
run: poetry install --extras sentry | |
- name: Typecheck the project | |
run: mypy gimvicurnik |