-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: ensure test fixtures are generated
- Loading branch information
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
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 |