ci: configure bors

This commit is contained in:
messense 2022-11-20 21:23:05 +08:00
parent 8ca41be87b
commit b7bbd7b497
No known key found for this signature in database
GPG Key ID: BB41A8A2C716CCA9
2 changed files with 36 additions and 0 deletions

7
.github/bors.toml vendored Normal file
View File

@ -0,0 +1,7 @@
delete_merged_branches = true
required_approvals = 0
use_codeowners = false
status = [
"conclusion",
]
timeout_sec = 21600

View File

@ -4,6 +4,10 @@ on:
push: push:
branches: branches:
- main - main
# for bors r+
- staging
# for bors try
- trying
pull_request: pull_request:
workflow_dispatch: workflow_dispatch:
@ -43,6 +47,7 @@ jobs:
check-target: check-target:
needs: [fmt] needs: [fmt]
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
strategy: strategy:
# If one platform fails, allow the rest to keep testing if `CI-no-fail-fast` label is present # If one platform fails, allow the rest to keep testing if `CI-no-fail-fast` label is present
fail-fast: ${{ !contains(github.event.pull_request.labels.*.name, 'CI-no-fail-fast') }} fail-fast: ${{ !contains(github.event.pull_request.labels.*.name, 'CI-no-fail-fast') }}
@ -313,6 +318,7 @@ jobs:
CARGO_PRIMARY_PACKAGE: 1 CARGO_PRIMARY_PACKAGE: 1
valgrind: valgrind:
if: github.event_name != 'pull_request'
needs: [fmt] needs: [fmt]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -336,6 +342,7 @@ jobs:
TRYBUILD: overwrite TRYBUILD: overwrite
careful: careful:
if: github.event_name != 'pull_request'
needs: [fmt] needs: [fmt]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -387,6 +394,7 @@ jobs:
emscripten: emscripten:
name: emscripten name: emscripten
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@ -416,3 +424,24 @@ jobs:
run: nox -s build-emscripten run: nox -s build-emscripten
- name: Test - name: Test
run: nox -s test-emscripten run: nox -s test-emscripten
conclusion:
needs:
- fmt
- clippy
- check-target
- build
- valgrind
- careful
- coverage
- emscripten
if: always()
runs-on: ubuntu-latest
steps:
- name: Result
run: |
jq -C <<< "${needs}"
# Check if all needs were successful or skipped.
"$(jq -r 'all(.result as $result | (["success", "skipped"] | contains([$result])))' <<< "${needs}")"
env:
needs: ${{ toJson(needs) }}