-
Notifications
You must be signed in to change notification settings - Fork 16
[Maintenance] Action pinning #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9cf8e76
Add zizmor
zerolab a079b52
Update the nightly tests action
zerolab cc592ee
Pin the test workflow actions
zerolab 6a83ba8
Pin actions in the publish workflow
zerolab 8e544e8
Pin actions in the ruff workflow
zerolab 5c0c77d
Fix typo
zerolab 0a1bad5
More typo fixes
zerolab be9d90f
Tweak coverage report
zerolab 58736d9
More coverage tweaks
zerolab e91890a
Fix ruff action
zerolab File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,30 @@ | ||
| """ | ||
| Called by GH Actions when the nightly build fails. | ||
| Called by GitHub Action when the nightly build fails. | ||
|
|
||
| This reports an error to the #nightly-build-failures Slack channel. | ||
| """ | ||
|
|
||
| import os | ||
|
|
||
| import requests | ||
| import urllib3 | ||
|
|
||
|
|
||
| if "SLACK_WEBHOOK_URL" in os.environ: | ||
| # https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-variables | ||
| repository = os.environ["GITHUB_REPOSITORY"] | ||
| run_id = os.environ["GITHUB_RUN_ID"] | ||
| url = f"https://github.com/{repository}/actions/runs/{run_id}" | ||
|
|
||
| print("Reporting to #nightly-build-failures slack channel") | ||
| response = requests.post( | ||
|
|
||
| urllib3.request( | ||
| "POST", | ||
| os.environ["SLACK_WEBHOOK_URL"], | ||
| json={ | ||
| "text": "A Nightly build failed. See https://github.com/wagtail-nest/wagtail-polymath/actions/runs/" | ||
| + os.environ["GITHUB_RUN_ID"], | ||
| }, | ||
| timeout=30, | ||
| json={"text": f"A Nightly build failed. See {url}"}, | ||
| ) | ||
|
|
||
| print("Slack responded with:", response) | ||
|
|
||
| else: | ||
| print( | ||
| "Unable to report to #nightly-build-failures slack channel because SLACK_WEBHOOK_URL is not set" | ||
| "Unable to report to #nightly-build-failures slack channel " | ||
| "because SLACK_WEBHOOK_URL is not set" | ||
| ) |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,37 +1,47 @@ | ||
| name: Nightly Wagtail Test | ||
| name: Nightly Wagtail test | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: '0 1 * * *' | ||
| # At 01:00, daily | ||
| # Weekly on Monday. | ||
| - cron: "0 0 * * 1" | ||
|
|
||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| WEBHOOK_EXISTS: ${{ secrets.SLACK_WEBHOOK_URL != '' }} | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| nightly-wagtail-test: | ||
| nightly-test: | ||
| name: Nightly tests against Wagtail main | ||
| # Cannot check the existence of secrets, so limiting to repository name to prevent all forks to run nightly. | ||
| # See: https://github.com/actions/runner/issues/520 | ||
| if: ${{ github.repository == 'wagtail-nest/wagtail-polymath' }} | ||
| runs-on: ubuntu-latest | ||
| if: ${{ vars.WEBHOOK_EXISTS }} | ||
| permissions: | ||
| contents: read # to fetch code (actions/checkout) | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v5 | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| python-version: '3.11' | ||
|
|
||
| - run: git clone https://github.com/wagtail/wagtail.git | ||
|
|
||
| - run: python -m pip install flit | ||
| - run: flit install --deps production --extras testing | ||
| - run: python -m pip install ./wagtail | ||
|
|
||
| - run: python tests/manage.py test | ||
|
|
||
| - name: Report failure | ||
| persist-credentials: false | ||
| - name: Set up Python | ||
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | ||
| with: | ||
| python-version: "3.14" | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip tox "urllib3==2.6.3" | ||
| - name: Test | ||
| id: test | ||
| continue-on-error: true | ||
| run: tox -e wagtailmain | ||
|
|
||
| - name: Send Slack notification on failure | ||
| if: steps.test.outcome == 'failure' | ||
| run: | | ||
| python -m pip install requests | ||
| python ./.github/scripts/report_nightly_build_failure.py | ||
| if: ${{ failure() && env.WEBHOOK_EXISTS == 'true' }} | ||
| python .github/scripts/report_nightly_build_failure.py | ||
| env: | ||
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| name: GitHub Actions Security Analysis with zizmor 🌈 | ||
|
|
||
| on: | ||
| push: | ||
| branches: ["main"] | ||
| pull_request: | ||
| branches: ["**"] | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| zizmor: | ||
| name: Run zizmor 🌈 | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| security-events: write # Required for upload-sarif (used by zizmor-action) to upload SARIF files. | ||
| contents: read # Only needed for private repos. Needed to clone the repo. | ||
| actions: read # Only needed for private repos. Needed for upload-sarif to read workflow run info. | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Run zizmor 🌈 | ||
| uses: zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6 |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍