-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Link percy builds with a specific pull request; remove unnecessary ar…
…tifact compression; Note manual status check application as to-be-removed; run percy only when certain files are changed
- Loading branch information
Showing
6 changed files
with
118 additions
and
52 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,48 @@ | ||
name: "Prepare Percy build" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
pr_number: | ||
required: true | ||
type: number | ||
repository: | ||
required: true | ||
type: string | ||
commitsh: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
copy_artifact: | ||
name: Prepare build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: | | ||
templates/docs/examples/ | ||
scss/ | ||
ref: ${{ github.event.inputs.commitsh }} | ||
repository: ${{ github.event.inputs.repository }} | ||
|
||
- name: Populate artifact directory | ||
run: | | ||
mkdir -p artifact | ||
cp -R templates/docs/examples/ scss/ artifact/. | ||
# Archive the PR number associated with this workflow since it won't be available in the base workflow context | ||
# https://github.com/orgs/community/discussions/25220 | ||
- name: Archive PR data | ||
if: github.event_name=='pull_request' | ||
working-directory: artifact | ||
run: | | ||
echo ${{ inputs.pr_number }} > pr_num.txt | ||
echo ${{ inputs.commitsh }} > pr_head_sha.txt | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: "percy-testing-web-artifact" | ||
path: artifact/* |
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
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,22 @@ | ||
# This workflow ensures Percy is executed against PRs with the Percy required label, regardless of which paths were changed | ||
name: "Percy [labeled]" | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
# workflow runs after a label is added to the PR, or when a commit is added to a PR with the Percy label | ||
- labeled | ||
- ready_for_review | ||
- synchronize | ||
|
||
jobs: | ||
copy_artifact: | ||
name: Prepare build | ||
if: contains(github.event.pull_request.labels.*.name, vars.PERCY_TEST_REQUESTED_LABEL_NAME) | ||
uses: ./.github/workflows/percy-prepare.yml | ||
with: | ||
pr_number: ${{ github.event.number }} | ||
repository: ${{ github.repository }} | ||
commitsh: ${{ github.event.pull_request.head.sha }} |
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,26 @@ | ||
# This workflow runs Percy against non-draft PRs that have changes in relevant examples filepaths. | ||
name: "Percy [pushed]" | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- "templates/docs/examples/**" | ||
- "scss/**" | ||
types: | ||
- opened | ||
- ready_for_review | ||
- synchronize | ||
|
||
jobs: | ||
copy_artifact: | ||
name: Prepare build | ||
# Ignore draft PRS and PRs with the Percy label | ||
# If we run tests against PRs with the Percy label, we will run tests twice (test is also ran by the labelling workflow) | ||
if: ${{ !github.event.pull_request.draft && !contains(github.event.pull_request.labels.*.name, vars.PERCY_TEST_REQUESTED_LABEL_NAME) }} | ||
uses: ./.github/workflows/percy-prepare.yml | ||
with: | ||
pr_number: ${{ github.event.number }} | ||
repository: ${{ github.repository }} | ||
commitsh: ${{ github.event.pull_request.head.sha }} |
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