mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Cancel main build if successful build already exists for commit
This commit is contained in:
parent
b375297465
commit
6e91966a9e
1 changed files with 26 additions and 0 deletions
26
.github/workflows/main.yml
vendored
26
.github/workflows/main.yml
vendored
|
@ -13,9 +13,31 @@ env:
|
||||||
SHELL: /bin/bash
|
SHELL: /bin/bash
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
decision:
|
||||||
|
name: Decision job
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- name: Previous successful build check
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
if ((await github.rest.actions.listWorkflowRuns({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
workflow_id: "main.yml",
|
||||||
|
head_sha: context.sha,
|
||||||
|
status: "success",
|
||||||
|
})).data.workflow_runs.length > 0)
|
||||||
|
await github.rest.actions.cancelWorkflowRun({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
run_id: context.runId,
|
||||||
|
});
|
||||||
|
|
||||||
build-win:
|
build-win:
|
||||||
name: Build (Windows)
|
name: Build (Windows)
|
||||||
runs-on: windows-2019
|
runs-on: windows-2019
|
||||||
|
needs: ["decision"]
|
||||||
steps:
|
steps:
|
||||||
- name: Branch check
|
- name: Branch check
|
||||||
if: ${{ !contains('refs/heads/auto refs/heads/try refs/heads/try-windows', github.ref) }}
|
if: ${{ !contains('refs/heads/auto refs/heads/try refs/heads/try-windows', github.ref) }}
|
||||||
|
@ -43,6 +65,7 @@ jobs:
|
||||||
build-uwp-x64:
|
build-uwp-x64:
|
||||||
name: Build (Windows UWP x64)
|
name: Build (Windows UWP x64)
|
||||||
runs-on: windows-2019
|
runs-on: windows-2019
|
||||||
|
needs: ["decision"]
|
||||||
steps:
|
steps:
|
||||||
- name: Branch check
|
- name: Branch check
|
||||||
if: ${{ !contains('refs/heads/auto refs/heads/try refs/heads/try-windows', github.ref) }}
|
if: ${{ !contains('refs/heads/auto refs/heads/try refs/heads/try-windows', github.ref) }}
|
||||||
|
@ -71,6 +94,7 @@ jobs:
|
||||||
build-uwp-arm64:
|
build-uwp-arm64:
|
||||||
name: Build (Windows UWP arm64)
|
name: Build (Windows UWP arm64)
|
||||||
runs-on: windows-2019
|
runs-on: windows-2019
|
||||||
|
needs: ["decision"]
|
||||||
steps:
|
steps:
|
||||||
- name: Branch check
|
- name: Branch check
|
||||||
if: ${{ !contains('refs/heads/auto refs/heads/try refs/heads/try-windows', github.ref) }}
|
if: ${{ !contains('refs/heads/auto refs/heads/try refs/heads/try-windows', github.ref) }}
|
||||||
|
@ -97,6 +121,7 @@ jobs:
|
||||||
build-mac:
|
build-mac:
|
||||||
name: Build (macOS)
|
name: Build (macOS)
|
||||||
runs-on: macos-12
|
runs-on: macos-12
|
||||||
|
needs: ["decision"]
|
||||||
steps:
|
steps:
|
||||||
- name: Branch check
|
- name: Branch check
|
||||||
if: ${{ !contains('refs/heads/auto refs/heads/try refs/heads/try-mac', github.ref) }}
|
if: ${{ !contains('refs/heads/auto refs/heads/try refs/heads/try-mac', github.ref) }}
|
||||||
|
@ -201,6 +226,7 @@ jobs:
|
||||||
build-linux:
|
build-linux:
|
||||||
name: Build (Linux)
|
name: Build (Linux)
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
needs: ["decision"]
|
||||||
steps:
|
steps:
|
||||||
- name: Branch check
|
- name: Branch check
|
||||||
if: ${{ !contains('refs/heads/auto refs/heads/try refs/heads/try-linux refs/heads/try-wpt', github.ref) }}
|
if: ${{ !contains('refs/heads/auto refs/heads/try refs/heads/try-linux refs/heads/try-wpt', github.ref) }}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue