⬆️(dependencies) update python dependencies #157
Workflow file for this run
This file contains hidden or 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: Main Workflow | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - "*" | |
| permissions: {} | |
| jobs: | |
| lint-git: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' # Makes sense only for pull requests | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 0 | |
| - name: show | |
| run: git log | |
| - name: Enforce absence of print statements in code | |
| if: always() | |
| run: | | |
| ! git diff "origin/${GIT_REF}..HEAD" -- . ':(exclude)**/backend.yml' | grep "print(" | |
| env: | |
| GIT_REF: ${{ github.event.pull_request.base.ref }} | |
| - name: Check absence of fixup commits | |
| if: always() | |
| run: | | |
| ! git log | grep 'fixup!' | |
| - name: Install gitlint | |
| if: always() | |
| run: pip install --user requests gitlint | |
| - name: Lint commit messages added to main | |
| if: always() | |
| run: ~/.local/bin/gitlint --commits "origin/${GIT_REF}..HEAD" | |
| env: | |
| GIT_REF: ${{ github.event.pull_request.base.ref }} | |
| check-changelog: | |
| runs-on: ubuntu-latest | |
| if: | | |
| contains(github.event.pull_request.labels.*.name, 'noChangeLog') == false && | |
| github.event_name == 'pull_request' | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 50 | |
| - name: Check that the CHANGELOG has been modified in the current branch | |
| run: git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.after }} | grep 'CHANGELOG.md' | |
| lint-changelog: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Check CHANGELOG max line length | |
| run: | | |
| max_line_length=$(cat CHANGELOG.md | grep -Ev "^\[.*\]: https://github.com" | wc -L) | |
| if [ $max_line_length -ge 80 ]; then | |
| echo "ERROR: CHANGELOG has lines longer than 80 characters." | |
| exit 1 | |
| fi | |
| lint-back: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: src/backend | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version-file: "./src/backend/.python-version" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | |
| with: | |
| version: "0.11.7" | |
| enable-cache: true | |
| - name: Install the project | |
| run: uv sync --locked --all-extras --dev | |
| - name: Check code formatting with ruff | |
| run: uv run ruff format . --diff | |
| - name: Lint code with ruff | |
| run: uv run ruff check . | |
| - name: Check types with ty | |
| run: uv run ty check | |
| test-back: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: src/backend | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_DB: menshen | |
| POSTGRES_USER: dinum | |
| POSTGRES_PASSWORD: pass | |
| ports: | |
| - 5432:5432 | |
| # needed because the postgres container does not provide a healthcheck | |
| options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
| env: | |
| DB_HOST: localhost | |
| DB_NAME: menshen | |
| DB_PASSWORD: pass | |
| DB_PORT: 5432 | |
| DB_USER: dinum | |
| DJANGO_CONFIGURATION: Test | |
| DJANGO_SECRET_KEY: ThisIsAnExampleKeyForTestPurposeOnly | |
| DJANGO_SETTINGS_MODULE: menshen.settings | |
| OIDC_OP_INTROSPECTION_ENDPOINT: "http://fake.local/realms/menshen/protocol/openid-connect/token/introspect" | |
| OIDC_OP_JWKS_ENDPOINT: /endpoint-for-test-purpose-only | |
| OIDC_OP_URL: "http://fake.local" | |
| OIDC_RS_CLIENT_ID: client_id | |
| OIDC_RS_CLIENT_SECRET: client_secret | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Create writable /data | |
| run: | | |
| sudo mkdir -p /data/media && \ | |
| sudo mkdir -p /data/static | |
| - name: Set up Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version-file: "./src/backend/.python-version" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | |
| with: | |
| version: "0.11.7" | |
| enable-cache: true | |
| - name: Install the dependencies | |
| run: uv sync --locked --all-extras --dev | |
| - name: Define required environment variables | |
| run: ../../bin/local-env | |
| - name: Run tests | |
| run: uv run pytest -n 2 |