Skip to content

Commit

Permalink
ci: ensure test fixtures are generated
Browse files Browse the repository at this point in the history
  • Loading branch information
abn committed Mar 19, 2024
1 parent 38ff03d commit 1b49f10
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/tests-ensure-fixtures.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Test Fixture Consistency

on:
pull_request:
branches:
- '**'

concurrency:
group: tests-fixture-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
changes:
name: Detect changed files
runs-on: ubuntu-latest
outputs:
pypi: ${{ steps.changes.outputs.pypi }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
pypi:
- 'tests/repositories/fixtures/pypi.org/**'
ensure-pypi:
name: PyPI
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.pypi == 'true'
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4

- name: Bootstrap poetry
run: pipx install poetry

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: poetry

- name: Configure poetry
run: |
poetry config virtualenvs.in-project true
poetry config virtualenvs.options.no-pip true
poetry config virtualenvs.options.no-setuptools true
- name: Install dependencies
run: poetry install --only main,test

- name: Regenerate PyPI fixtures
run: PYTHONPATH="$PWD" poetry run python tests/repositories/fixtures/pypi.org/generate.py

- name: Check for changed files
run: git diff --exit-code --stat HEAD tests/repositories/fixtures/pypi.org

0 comments on commit 1b49f10

Please sign in to comment.