mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Fix the try build when pushing to branches (#30903)
Make it so that all try builds go through try.yml and pass workflow_call arguments as expected to subsequent workflows. Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
parent
74798c4b7b
commit
f2882879d8
6 changed files with 47 additions and 39 deletions
2
.github/workflows/linux-wpt.yml
vendored
2
.github/workflows/linux-wpt.yml
vendored
|
@ -113,7 +113,7 @@ jobs:
|
||||||
report-test-results:
|
report-test-results:
|
||||||
name: Report WPT Results
|
name: Report WPT Results
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ always() && !cancelled() && (github.ref_name == 'try-wpt' || github.ref_name == 'try-wpt-2020' || inputs.wpt == 'test') }}
|
if: ${{ always() && !cancelled() && inputs.wpt == 'test' }}
|
||||||
needs:
|
needs:
|
||||||
- "linux-wpt"
|
- "linux-wpt"
|
||||||
steps:
|
steps:
|
||||||
|
|
10
.github/workflows/linux.yml
vendored
10
.github/workflows/linux.yml
vendored
|
@ -47,8 +47,6 @@ on:
|
||||||
required: false
|
required: false
|
||||||
default: false
|
default: false
|
||||||
type: boolean
|
type: boolean
|
||||||
push:
|
|
||||||
branches: ["try-linux", "try-wpt", "try-wpt-2020"]
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
|
@ -96,11 +94,11 @@ jobs:
|
||||||
- name: Build (${{ inputs.profile }})
|
- name: Build (${{ inputs.profile }})
|
||||||
run: python3 ./mach build --${{ inputs.profile }}
|
run: python3 ./mach build --${{ inputs.profile }}
|
||||||
- name: Smoketest
|
- name: Smoketest
|
||||||
run: xvfb-run python3 ./mach smoketest --${{ inputs.profile }}
|
run: xvfb-run python3 ./mach smoketest --${{ inputs.profile }}
|
||||||
- name: Script tests
|
- name: Script tests
|
||||||
run: ./mach test-scripts
|
run: ./mach test-scripts
|
||||||
- name: Unit tests
|
- name: Unit tests
|
||||||
if: ${{ inputs.unit-tests || github.ref_name == 'try-linux' }}
|
if: ${{ inputs.unit-tests }}
|
||||||
uses: nick-fields/retry@v2
|
uses: nick-fields/retry@v2
|
||||||
with:
|
with:
|
||||||
timeout_minutes: 20
|
timeout_minutes: 20
|
||||||
|
@ -142,7 +140,7 @@ jobs:
|
||||||
path: target.tar.gz
|
path: target.tar.gz
|
||||||
|
|
||||||
wpt-2020:
|
wpt-2020:
|
||||||
if: ${{ github.ref_name == 'try-wpt-2020' || inputs.layout == '2020' || inputs.layout == 'all' }}
|
if: ${{ inputs.layout == '2020' || inputs.layout == 'all' }}
|
||||||
name: Linux WPT Tests 2020
|
name: Linux WPT Tests 2020
|
||||||
needs: ["build"]
|
needs: ["build"]
|
||||||
uses: ./.github/workflows/linux-wpt.yml
|
uses: ./.github/workflows/linux-wpt.yml
|
||||||
|
@ -153,7 +151,7 @@ jobs:
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
wpt-2013:
|
wpt-2013:
|
||||||
if: ${{ github.ref_name == 'try-wpt' || inputs.layout == '2013' || inputs.layout == 'all' }}
|
if: ${{ inputs.layout == '2013' || inputs.layout == 'all' }}
|
||||||
name: Linux WPT Tests 2013
|
name: Linux WPT Tests 2013
|
||||||
needs: ["build"]
|
needs: ["build"]
|
||||||
uses: ./.github/workflows/linux-wpt.yml
|
uses: ./.github/workflows/linux-wpt.yml
|
||||||
|
|
8
.github/workflows/mac.yml
vendored
8
.github/workflows/mac.yml
vendored
|
@ -40,8 +40,6 @@ on:
|
||||||
required: false
|
required: false
|
||||||
default: false
|
default: false
|
||||||
type: boolean
|
type: boolean
|
||||||
push:
|
|
||||||
branches: ["try-mac", "try-wpt-mac", "try-wpt-mac-2020"]
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
|
@ -97,7 +95,7 @@ jobs:
|
||||||
- name: Script tests
|
- name: Script tests
|
||||||
run: ./mach test-scripts
|
run: ./mach test-scripts
|
||||||
- name: Unit tests
|
- name: Unit tests
|
||||||
if: ${{ inputs.unit-tests || github.ref_name == 'try-mac' }}
|
if: ${{ inputs.unit-tests }}
|
||||||
uses: nick-fields/retry@v2
|
uses: nick-fields/retry@v2
|
||||||
with:
|
with:
|
||||||
timeout_minutes: 20 # https://github.com/servo/servo/issues/30275
|
timeout_minutes: 20 # https://github.com/servo/servo/issues/30275
|
||||||
|
@ -143,7 +141,7 @@ jobs:
|
||||||
path: target.tar.gz
|
path: target.tar.gz
|
||||||
|
|
||||||
wpt-2020:
|
wpt-2020:
|
||||||
if: ${{ github.ref_name == 'try-wpt-mac-2020' || inputs.wpt-layout == '2020' || inputs.wpt-layout == 'all' }}
|
if: ${{ inputs.wpt-layout == '2020' || inputs.wpt-layout == 'all' }}
|
||||||
name: Mac WPT Tests 2020
|
name: Mac WPT Tests 2020
|
||||||
needs: ["build"]
|
needs: ["build"]
|
||||||
uses: ./.github/workflows/mac-wpt.yml
|
uses: ./.github/workflows/mac-wpt.yml
|
||||||
|
@ -153,7 +151,7 @@ jobs:
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
wpt-2013:
|
wpt-2013:
|
||||||
if: ${{ github.ref_name == 'try-wpt-mac' || inputs.wpt-layout == '2013' || inputs.wpt-layout == 'all' }}
|
if: ${{ inputs.wpt-layout == '2013' || inputs.wpt-layout == 'all' }}
|
||||||
name: Mac WPT Tests 2013
|
name: Mac WPT Tests 2013
|
||||||
needs: ["build"]
|
needs: ["build"]
|
||||||
uses: ./.github/workflows/mac-wpt.yml
|
uses: ./.github/workflows/mac-wpt.yml
|
||||||
|
|
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
|
@ -5,7 +5,7 @@ on:
|
||||||
# Run the entire pipeline for 'main' even though the merge queue already runs checks
|
# Run the entire pipeline for 'main' even though the merge queue already runs checks
|
||||||
# for every change. This just offers an extra layer of testing and covers the case of
|
# for every change. This just offers an extra layer of testing and covers the case of
|
||||||
# random force pushes.
|
# random force pushes.
|
||||||
branches: ["main", "try"]
|
branches: ["main"]
|
||||||
pull_request:
|
pull_request:
|
||||||
types: ['opened', 'synchronize']
|
types: ['opened', 'synchronize']
|
||||||
branches: ["**"]
|
branches: ["**"]
|
||||||
|
|
60
.github/workflows/try.yml
vendored
60
.github/workflows/try.yml
vendored
|
@ -3,6 +3,8 @@ name: Try
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
types: [labeled]
|
types: [labeled]
|
||||||
|
push:
|
||||||
|
branches: ["try", "try-linux", "try-mac", "try-wpt-mac", "try-wpt-mac-2020", "try-wpt", "try-wpt-2020", "try-windows"]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
parse-comment:
|
parse-comment:
|
||||||
|
@ -19,6 +21,10 @@ jobs:
|
||||||
script: |
|
script: |
|
||||||
function makeComment(body) {
|
function makeComment(body) {
|
||||||
console.log(body);
|
console.log(body);
|
||||||
|
|
||||||
|
if (github.event_name != 'pull_request_target')
|
||||||
|
return;
|
||||||
|
|
||||||
github.rest.issues.createComment({
|
github.rest.issues.createComment({
|
||||||
issue_number: context.issue.number,
|
issue_number: context.issue.number,
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
|
@ -62,7 +68,7 @@ jobs:
|
||||||
if (tryString.includes("linux")) {
|
if (tryString.includes("linux")) {
|
||||||
addPlatformToConfiguration("linux", configuration);
|
addPlatformToConfiguration("linux", configuration);
|
||||||
configuration.unit_tests = true;
|
configuration.unit_tests = true;
|
||||||
} else if (tryString.includes("macos")) {
|
} else if (tryString.includes("mac")) {
|
||||||
addPlatformToConfiguration("macos", configuration);
|
addPlatformToConfiguration("macos", configuration);
|
||||||
configuration.unit_tests = true;
|
configuration.unit_tests = true;
|
||||||
} else if (tryString.includes("win")) {
|
} else if (tryString.includes("win")) {
|
||||||
|
@ -86,28 +92,36 @@ jobs:
|
||||||
unit_tests: false,
|
unit_tests: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
let try_labels = [];
|
if (github.event_name == 'pull_request_target') {
|
||||||
for (const label of context.payload.pull_request.labels) {
|
for (const label of context.payload.pull_request.labels) {
|
||||||
if (!label.name.startsWith("T-")) {
|
if (!label.name.startsWith("T-")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to remove the label. If that fails, it's likely that another
|
// Try to remove the label. If that fails, it's likely that another
|
||||||
// workflow has already processed it or a user has removed it.
|
// workflow has already processed it or a user has removed it.
|
||||||
try {
|
try {
|
||||||
await github.rest.issues.removeLabel({
|
await github.rest.issues.removeLabel({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
issue_number: context.issue.number,
|
issue_number: context.issue.number,
|
||||||
name: label.name,
|
name: label.name,
|
||||||
});
|
});
|
||||||
} catch (exception) {
|
} catch (exception) {
|
||||||
console.log("Assuming '" + label.name + "' is already removed: " + exception);
|
console.log("Assuming '" + label.name + "' is already removed: " + exception);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("Found label: " + label.name);
|
console.log("Found label: " + label.name);
|
||||||
updateConfigurationFromString(label.name, configuration);
|
updateConfigurationFromString(label.name, configuration);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let ref_name = "${{ github.ref_name || 'empty' }}";
|
||||||
|
if (ref_name == "try") {
|
||||||
|
updateConfigurationFromString("full", configuration);
|
||||||
|
} else {
|
||||||
|
updateConfigurationFromString(ref_name, configuration);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(JSON.stringify(configuration));
|
console.log(JSON.stringify(configuration));
|
||||||
|
@ -152,7 +166,7 @@ jobs:
|
||||||
if: ${{ always() && fromJson(needs.parse-comment.outputs.configuration).platforms[0] != null }}
|
if: ${{ always() && fromJson(needs.parse-comment.outputs.configuration).platforms[0] != null }}
|
||||||
steps:
|
steps:
|
||||||
- name: Success
|
- name: Success
|
||||||
if: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
|
if: ${{ github.event_name == 'pull_request_target' && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v6
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
|
@ -168,7 +182,7 @@ jobs:
|
||||||
body: "✨ Try run (" + formattedURL + ") " + "succeeded.",
|
body: "✨ Try run (" + formattedURL + ") " + "succeeded.",
|
||||||
});
|
});
|
||||||
- name: Failure
|
- name: Failure
|
||||||
if: ${{ contains(needs.*.result, 'failure') }}
|
if: ${{ github.event_name == 'pull_request_target' && contains(needs.*.result, 'failure') }}
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v6
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
|
|
4
.github/workflows/windows.yml
vendored
4
.github/workflows/windows.yml
vendored
|
@ -32,8 +32,6 @@ on:
|
||||||
required: false
|
required: false
|
||||||
default: false
|
default: false
|
||||||
type: boolean
|
type: boolean
|
||||||
push:
|
|
||||||
branches: ["try-windows"]
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
|
@ -89,7 +87,7 @@ jobs:
|
||||||
- name: Smoketest
|
- name: Smoketest
|
||||||
run: python mach smoketest --angle --${{ inputs.profile }}
|
run: python mach smoketest --angle --${{ inputs.profile }}
|
||||||
- name: Unit tests
|
- name: Unit tests
|
||||||
if: ${{ inputs.unit-tests || github.ref_name == 'try-windows' }}
|
if: ${{ inputs.unit-tests }}
|
||||||
uses: nick-fields/retry@v2
|
uses: nick-fields/retry@v2
|
||||||
with:
|
with:
|
||||||
timeout_minutes: 30
|
timeout_minutes: 30
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue