-
Notifications
You must be signed in to change notification settings - Fork 8k
[CI] Combine push and root #21251
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
Closed
+36
−66
Closed
[CI] Combine push and root #21251
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f8c69b3
Rename nightly_matrix.php to matrix.php
iluuu1994 c740d7c
Rename nightly.yml to test-suite.yml
iluuu1994 1a604ae
Rename push.yml to test.yml
iluuu1994 4f9ed98
Combine push.yml and root.yml into test.yml
iluuu1994 33a1b50
Improve displayed workflow_call name
iluuu1994 33a5586
Adjust nightly-results.yml for test.yml
iluuu1994 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
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 was deleted.
Oops, something went wrong.
File renamed without changes.
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,4 +1,4 @@ | ||
| name: Push | ||
| name: Test | ||
| on: | ||
| push: | ||
| paths-ignore: &ignore_paths | ||
|
|
@@ -21,6 +21,8 @@ on: | |
| paths-ignore: *ignore_paths | ||
| branches: | ||
| - '**' | ||
| schedule: | ||
| - cron: "0 1 * * *" | ||
| workflow_dispatch: ~ | ||
| permissions: | ||
| contents: read | ||
|
|
@@ -33,20 +35,35 @@ env: | |
| jobs: | ||
| GENERATE_MATRIX: | ||
| name: Generate Matrix | ||
| if: github.repository == 'php/php-src' || github.event_name == 'pull_request' | ||
| if: github.repository == 'php/php-src' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| all_variations: ${{ steps.set-matrix.outputs.all_variations }} | ||
| branches: ${{ steps.set-matrix.outputs.branches }} | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| # When running nightly, set fetch-depth to 0 to clone the full | ||
| # repository including all branches. This is required to find the | ||
| # correct commit hashes. | ||
| fetch-depth: ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && 0 || 1 }} | ||
| - name: Grab the commit mapping | ||
| if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} | ||
| uses: actions/cache@v5 | ||
| with: | ||
| path: branch-commit-cache.json | ||
| # The cache key needs to change every time for the | ||
| # cache to be updated after this job finishes. | ||
| key: nightly-${{ github.run_id }}-${{ github.run_attempt }} | ||
| restore-keys: | | ||
| nightly- | ||
| - name: Generate Matrix | ||
| id: set-matrix | ||
| run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}" "${{ github.ref }}" '${{ toJSON(github.event.pull_request.labels) }}' "${{ github.repository }}" | ||
| run: php .github/matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}" "${{ github.ref }}" '${{ toJSON(github.event.pull_request.labels) }}' "${{ github.repository }}" | ||
| PUSH: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be renamed. |
||
| needs: GENERATE_MATRIX | ||
| name: ${{ matrix.branch.ref }} | ||
| uses: ./.github/workflows/nightly.yml | ||
| name: ${{ matrix.branch.name }} | ||
| uses: ./.github/workflows/test-suite.yml | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
|
|
||
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.
I think this might not work correctly, because
0is falsy in JavaScript, which I believe backs the expression syntax.&& "0" || "1"should do the trick.Possibly it also makes sense to add an extra step setting a “helper” variable, for readability:
And then use
${{ steps.is-nightly.outputs.nightly }}in conditions instead of repeating them.Uh oh!
There was an error while loading. Please reload this page.
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.
Very good catch. I fixed this in the first way you suggested for now. And I also remembered that
""needs to be''after I already pushed the fix. ^^