-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from chrysle/ci-check-table-alteration
CI: Check for uncommitted table alteration
- Loading branch information
Showing
4 changed files
with
61 additions
and
28 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,56 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: ["master", "src-layout"] | ||
pull_request: | ||
branches: ["master", "src-layout"] | ||
schedule: | ||
- cron: "0 12 1 * *" | ||
|
||
permissions: | ||
contents: read | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
generate-compatibility-matrix: | ||
name: >- | ||
Check for any uncommitted | ||
table alteration | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Determine Python versions | ||
run: | | ||
{ | ||
echo 'PYTHON_VERSIONS<<EOF' | ||
cat '.python-versions-used' | ||
echo 'EOF' | ||
} >> $GITHUB_ENV | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSIONS }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install -r requirements.txt | ||
- name: Generate compatibility matrix with nox | ||
continue-on-error: true | ||
run: | | ||
python -m nox --report report.json | ||
- name: Verify table has not been altered | ||
run: | | ||
set -xeEuo pipefail | ||
cat report.json | ||
python report_to_table.py | ||
echo 'DIFF_FOR_TABLE<<EOF' >> "${GITHUB_OUTPUT}" | ||
git diff table.md | tee -a "${GITHUB_OUTPUT}" | ||
echo 'EOF' >> "${GITHUB_OUTPUT}" | ||
id: verify-table | ||
- name: Fail the job if the committed table differs from the calculated one | ||
if: steps.verify-table.outputs.DIFF_FOR_TABLE != '' | ||
run: | | ||
echo "::error file=table.md::Table has been altered but not committed!" | ||
exit 1 |
This file was deleted.
Oops, something went wrong.
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,3 @@ | ||
3.8 | ||
3.10 | ||
3.12 |
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