diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 576fb48..912e801 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,5 +1,12 @@ name: CI +env: + # Current supported Python version. For applications, there is generally no + # reason to support multiple Python versions, so all actions are run with + # this version. Quote the version to avoid interpretation as a floating + # point number. + PYTHON_VERSION: "3.12" + "on": merge_group: {} pull_request: {} @@ -28,7 +35,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: ${{ env.PYTHON_VERSION }} - name: Run pre-commit uses: pre-commit/action@v3.0.1 @@ -37,20 +44,15 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 - strategy: - matrix: - python: - - "3.12" - steps: - uses: actions/checkout@v4 - name: Run tox uses: lsst-sqre/run-tox@v1 with: - python-version: ${{ matrix.python }} + python-version: ${{ env.PYTHON_VERSION }} tox-envs: "py,coverage-report,typing" - tox-plugins: "tox-docker tox-uv" + tox-requirements: requirements/tox.txt build: runs-on: ubuntu-latest diff --git a/.github/workflows/periodic-ci.yaml b/.github/workflows/periodic-ci.yaml index 19accc0..9ed4b08 100644 --- a/.github/workflows/periodic-ci.yaml +++ b/.github/workflows/periodic-ci.yaml @@ -5,6 +5,13 @@ name: Periodic CI +env: + # Current supported Python version. For applications, there is generally no + # reason to support multiple Python versions, so all actions are run with + # this version. Quote the version to avoid interpretation as a floating + # point number. + PYTHON_VERSION: "3.12" + "on": schedule: - cron: "0 12 * * 1" @@ -15,33 +22,32 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 - strategy: - matrix: - python: - - "3.12" - steps: - uses: actions/checkout@v4 - # Use the oldest supported version of Python to update dependencies, - # not the matrixed Python version, since this accurately reflects - # how dependencies should later be updated. - - name: Run neophile - uses: lsst-sqre/run-neophile@v1 + - name: Set up Python + uses: actions/setup-python@v5 with: - python-version: "3.12" - mode: update + python-version: ${{ env.PYTHON_VERSION }} + + - name: Update dependencies + run: | + pip install --upgrade uv + uv venv + source .venv/bin/activate + make update-deps + shell: bash - name: Run tests in tox uses: lsst-sqre/run-tox@v1 with: python-version: ${{ matrix.python }} tox-envs: "lint,typing,py" + tox-requirements: requirements/tox.txt use-cache: false - tox-plugins: "tox-docker tox-uv" - name: Report status - if: always() + if: failure() uses: ravsamhq/notify-slack-action@v2 with: status: ${{ job.status }}