Skip to content

Merge pull request #212 from ManoManoTech/hotfix/mypy-signature-impor… #1139

Merge pull request #212 from ManoManoTech/hotfix/mypy-signature-impor…

Merge pull request #212 from ManoManoTech/hotfix/mypy-signature-impor… #1139

Workflow file for this run

---
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
name: Python CI
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
python_build:
name: Test and build Python
env:
PYTHONDEVMODE: 1
FF_SLACK_SKIP_CHECKS: true
ENABLE_JIRA: true
ENABLE_RAID: true
runs-on: "ubuntu-latest"
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres:13-alpine
# Provide the password for postgres
env:
POSTGRES_DB: ff_dev
POSTGRES_USER: firefighter
POSTGRES_PASSWORD: firefighter
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
# Docker Hub image
image: redis:6-alpine
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v3
with:
experimental: true
- name: Verify tool versions
run: |
echo "=== Mise tools ==="
mise list
echo "=== PDM version ==="
pdm --version
echo "=== Python version ==="
python --version
- name: Configure git
run: |
git config --global user.email "firefighter@manomano.com"
git config --global user.name "FireFighter Release CI"
- name: Fake .git for act
if: ${{ env.ACT }}
run: |
git init
git add .
git commit -a -m "chore(act): fake commit"
git log
- name: Install dependencies
run: pdm install --dev --frozen-lockfile -v && pdm info
- name: Run Tests
run: |
cp .env.example .env
pdm run collectstatic
pdm run tests-cov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
if: ${{ ! env.ACT }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
- name: Type check with mypy
run: |
pdm run lint-mypy
- name: Lint with ruff
run: |
pdm run lint-ruff --output-format=github --exit-non-zero-on-fix
- name: "Build wheel"
run: pdm build --no-sdist --no-clean
- name: "Build sdist"
run: pdm build --no-wheel --no-clean
- name: Publish Python artifacts on Github artifacts
uses: actions/upload-artifact@v4
if: ${{ ! env.ACT }} && ${{ matrix.python-version == env.PYTHON_VERSION }}

Check warning on line 105 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / Python CI

Workflow syntax warning

.github/workflows/ci.yml (Line: 105, Col: 13): Conditional expression contains literal text outside replacement tokens. This will cause the expression to always evaluate to truthy. Did you mean to put the entire expression inside ${{ }}?
with:
name: python-artifacts
path: |
dist/*.whl
dist/*.tar.gz