Packet enhancements #367
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: CI | |
| on: | |
| pull_request: | |
| branches: | |
| - "main" | |
| - "20*" | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| FORCE_COLOR: "1" # Make tools pretty. | |
| PIP_DISABLE_PIP_VERSION_CHECK: "1" | |
| PIP_NO_PYTHON_VERSION_WARNING: "1" | |
| permissions: | |
| contents: read | |
| jobs: | |
| zizmor: | |
| name: Zizmor | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read # only needed for private repos | |
| actions: read # only needed for private repos | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| persist-credentials: false | |
| - name: Run zizmor 🌈 | |
| uses: zizmorcore/zizmor-action@f52a838cfabf134edcbaa7c8b3677dde20045018 # v0.1.1 | |
| with: | |
| advanced-security: false | |
| build-package: | |
| name: Build & verify package | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - uses: hynek/build-and-inspect-python-package@efb823f52190ad02594531168b7a2d5790e66516 # v2.14.0 | |
| id: baipp | |
| outputs: | |
| python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }} | |
| tests: | |
| name: Lint and Test | |
| runs-on: ubuntu-latest | |
| needs: build-package | |
| env: | |
| SETUPTOOLS_SCM_PRETEND_VERSION: "2025.0.0" | |
| UV_PYTHON_PREFERENCE: managed | |
| UV_PYTHON: "3.13" | |
| NOM_DB_NAME: gha_test | |
| NOM_DB_HOST: localhost | |
| NOM_DB_PORT: "52432" | |
| NOM_DB_USER: gha | |
| NOM_OAUTH_KEY: bogon | |
| NOM_OAUTH_SECRET: bogon | |
| NOM_REDIS_HOST: localhost | |
| NOM_EMAIL_HOST: localhost | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| persist-credentials: false | |
| - uses: extractions/setup-just@dd310ad5a97d8e7b41793f8ef055398d51ad4de6 # v2.0.0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231 # v5.3.1 | |
| - name: lint | |
| run: | | |
| just lint | |
| - name: generate some passwords | |
| run: | | |
| DB_PASSWORD=$(openssl rand -hex 8) | |
| SECRET_KEY=$(openssl rand -hex 16) | |
| echo "Run-specific DB password: $DB_PASSWORD" | |
| echo "Run-specific secret key: $SECRET_KEY" | |
| echo "NOM_DB_PASSWORD=$DB_PASSWORD" >> "$GITHUB_ENV" | |
| echo "NOM_SECRET_KEY=$SECRET_KEY" >> "$GITHUB_ENV" | |
| # slugify the python version | |
| CI_SERVICES_SUFFIX=$(echo ${{ matrix.python-version }} | tr '.-' '__') | |
| echo "COMPOSE_PROJECT_NAME=nomnom-ci-${CI_SERVICES_SUFFIX}" >> "$GITHUB_ENV" | |
| - name: Start the database | |
| run: scripts/ci/db-up.sh | |
| - name: Run tests | |
| run: | | |
| just test | |
| - name: Check for missing bits in template | |
| run: scripts/ci/check-bits |