mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 21:07:28 -08:00
ci(editor): Do not run parallel jobs for a single spec (no-changelog) (#6052)
* ci(editor): Do not run parallel jobs for a single spec * Fix syntax * Only post e2e success comment on actual e2e success * Set e2e-reusable output and check all container state
This commit is contained in:
parent
ac245fdb8d
commit
d17d050a16
32
.github/workflows/e2e-reusable.yml
vendored
32
.github/workflows/e2e-reusable.yml
vendored
|
@ -47,6 +47,11 @@ on:
|
|||
CYPRESS_RECORD_KEY:
|
||||
description: 'Cypress record key.'
|
||||
required: true
|
||||
outputs:
|
||||
tests_passed:
|
||||
description: 'True if all E2E tests passed, otherwise false'
|
||||
value: ${{ jobs.check_testing_matrix.outputs.all_tests_passed }}
|
||||
|
||||
|
||||
jobs:
|
||||
# single job that generates and outputs a common id
|
||||
|
@ -109,7 +114,9 @@ jobs:
|
|||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
containers: ${{ fromJSON(inputs.containers) }}
|
||||
# If spec is not e2e/* then we run only one container to prevent
|
||||
# running the same tests multiple times
|
||||
containers: ${{ fromJSON( inputs.spec == 'e2e/*' && inputs.containers || '[1]' ) }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
|
@ -135,9 +142,9 @@ jobs:
|
|||
install: false
|
||||
start: pnpm start
|
||||
wait-on: 'http://localhost:5678'
|
||||
wait-on-timeout: 120 #
|
||||
wait-on-timeout: 120
|
||||
record: ${{ inputs.record }}
|
||||
parallel: ${{ inputs.parallel }}
|
||||
parallel: ${{ fromJSON( inputs.spec == 'e2e/*' && inputs.parallel || false ) }}
|
||||
# We have to provide custom ci-build-id key to make sure that this workflow could be run multiple times
|
||||
# in the same parent workflow
|
||||
ci-build-id: ${{ needs.prepare.outputs.uuid }}
|
||||
|
@ -148,3 +155,22 @@ jobs:
|
|||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
E2E_TESTS: true
|
||||
COMMIT_INFO_MESSAGE: 🌳 ${{ inputs.branch }} 🖥️ ${{ inputs.run-env }} 🤖 ${{ inputs.user }} 🗃️ ${{ inputs.spec }}
|
||||
|
||||
# Check if all tests passed and set the output variable
|
||||
check_testing_matrix:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [testing]
|
||||
outputs:
|
||||
all_tests_passed: ${{ steps.all_tests_passed.outputs.result }}
|
||||
steps:
|
||||
- name: Check all tests passed
|
||||
id: all_tests_passed
|
||||
run: |
|
||||
success=true
|
||||
for status in ${{ needs.testing.result }}; do
|
||||
if [ $status != "success" ]; then
|
||||
success=false
|
||||
break
|
||||
fi
|
||||
done
|
||||
echo "::set-output name=result::$success"
|
||||
|
|
2
.github/workflows/e2e-tests-pr.yml
vendored
2
.github/workflows/e2e-tests-pr.yml
vendored
|
@ -26,7 +26,7 @@ jobs:
|
|||
if: always()
|
||||
steps:
|
||||
- name: E2E success comment
|
||||
if: ${{!contains(github.event.pull_request.labels.*.name, 'community') || needs.run-e2e-tests.result == 'success' }}
|
||||
if: ${{!contains(github.event.pull_request.labels.*.name, 'community') && needs.run-e2e-tests.outputs.tests_passed == 'true' }}
|
||||
uses: peter-evans/create-or-update-comment@v3
|
||||
with:
|
||||
issue-number: ${{ github.event.pull_request.number }}
|
||||
|
|
Loading…
Reference in a new issue