Skip to content
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

ci: fix mergify matrix integration tests #8267

Merged
merged 4 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ on:
- converted_to_draft
- ready_for_review
- labeled
- unlabeled
- auto_merge_enabled
- auto_merge_disabled
merge_group:
Expand All @@ -43,6 +44,9 @@ jobs:
fail-fast: false
matrix:
cli: [link-cli, local-npm]
# Mark a failure of `local-npm` as a successful result
# TODO: remove when `local-npm` job is fixed
continue-on-error: ${{ matrix.cli == 'local-npm' }}
timeout-minutes: 40
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -269,6 +273,8 @@ jobs:
strategy:
matrix:
bootstrap-version: ['test', 'main']
# Uncomment to mark a failure of the `test` bootstrap job as a successful result
# continue-on-error: ${{ matrix.bootstrap-version == 'test' }}
steps:
- name: free up disk space
run: |
Expand Down Expand Up @@ -311,3 +317,22 @@ jobs:
timeout-minutes: 4
with:
datadog-token: ${{ secrets.DATADOG_API_KEY }}

integration-test-result:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love it! This is totally clear and maintainable.

needs:
- pre_check
- getting-started
- deployment-test
- test-docker-build
if: needs.pre_check.outputs.should_run == 'true' && (success() || failure() || cancelled())
runs-on: ubuntu-latest
steps:
- name: Check job results
shell: bash
run: |
cat <<EOF
needs ${{ toJSON(needs) }}
EOF
[ "${{ needs.getting-started.result }}" = "success" ] || exit 1
[ "${{ needs.deployment-test.result }}" = "success" ] || exit 1
[ "${{ needs.test-docker-build.result }}" = "success" ] || exit 1
1 change: 1 addition & 0 deletions .github/workflows/mergify-ready.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- converted_to_draft
- ready_for_review
- labeled
- unlabeled
- auto_merge_enabled
- auto_merge_disabled
merge_group:
Expand Down
37 changes: 4 additions & 33 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,17 @@ queue_rules:
- base=master
# Require integration tests before merging only
- or:
- label=bypass:integration
- check-failure!=Integration tests
- or:
- label=bypass:integration
- check-success=deployment-test
- check-neutral=deployment-test
- check-skipped=deployment-test
- or:
- label=bypass:integration
- check-failure!=test-docker-build (main)
- or:
- label=bypass:integration
- check-skipped=test-docker-build
- check-success=test-docker-build (main)
- check-neutral=test-docker-build (main)
- check-skipped=test-docker-build (main)
- or:
- label=bypass:integration
- check-failure!=getting-started (link-cli)
- or:
- label=bypass:integration
- check-skipped=getting-started
- check-success=getting-started (link-cli)
- check-neutral=getting-started (link-cli)
- check-skipped=getting-started (link-cli)
# FIXME: Enable this section to validate NPM deploys...
#- or:
# - label=bypass:integration
# - check-skipped=getting-started
# - check-success=getting-started (local-npm)
# - check-neutral=getting-started (local-npm)
# - check-skipped=getting-started (local-npm)
- check-success=integration-test-result
- check-neutral=integration-test-result
- check-skipped=integration-test-result

pull_request_rules:
- name: merge to master
conditions:
- base=master
- label=automerge:no-update
- or:
- "#commits-behind=0"
- '#commits-behind=0'
- label=bypass:linear-history
- or:
- check-success=wait-integration-pre-checks
Expand Down