mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
* ci: fix reference to android job filename in main.yml * mach: fix build command to handle android The refactoring done in PR #31092 introduced the call to get_binary_path in the unconditional path, but did not pass the android flag to the call. Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> --------- Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
157 lines
5.2 KiB
YAML
157 lines
5.2 KiB
YAML
name: Main
|
|
|
|
on:
|
|
push:
|
|
# 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
|
|
# random force pushes.
|
|
branches: ["main"]
|
|
pull_request:
|
|
types: ['opened', 'synchronize']
|
|
branches: ["**"]
|
|
merge_group:
|
|
types: [checks_requested]
|
|
workflow_call:
|
|
inputs:
|
|
configuration:
|
|
required: true
|
|
type: string
|
|
workflow_dispatch:
|
|
inputs:
|
|
profile:
|
|
required: false
|
|
default: "release"
|
|
type: choice
|
|
options: ["release", "debug", "production"]
|
|
wpt-tests-to-run:
|
|
default: ""
|
|
required: false
|
|
type: string
|
|
platform:
|
|
required: false
|
|
type: choice
|
|
options: ["linux", "windows", "macos", "all"]
|
|
wpt-layout:
|
|
required: false
|
|
type: choice
|
|
options: ["none", "2013", "2020", "all"]
|
|
unit-tests:
|
|
required: false
|
|
type: boolean
|
|
|
|
jobs:
|
|
decision:
|
|
name: Decision
|
|
runs-on: ubuntu-20.04
|
|
outputs:
|
|
configuration: ${{ steps.configuration.outputs.result }}
|
|
steps:
|
|
- name: Configuration
|
|
id: configuration
|
|
uses: actions/github-script@v6
|
|
with:
|
|
script: |
|
|
// If this is a workflow call with a configuration object,
|
|
// then just return it immediately.
|
|
let configuration = ${{ inputs.configuration || '""' }};
|
|
if (configuration != "") {
|
|
console.log("Using configuration: " + JSON.stringify(configuration));
|
|
return configuration;
|
|
}
|
|
|
|
// We need to pick defaults if the inputs are not provided. Unprovided inputs
|
|
// are empty strings in this template.
|
|
let platform = "${{ inputs.platform }}" || "linux";
|
|
let profile = "${{ inputs.profile }}" || "release";
|
|
let wpt_layout = "${{ inputs.wpt-layout }}" || "none";
|
|
let wpt_tests_to_run = "${{ inputs.wpt-tests-to-run }}" || "";
|
|
let unit_tests = Boolean(${{ inputs.unit-tests }})
|
|
|
|
// Merge queue runs and pushes to `main` should always trigger a full build and test.
|
|
if (["push", "merge_group"].includes(context.eventName)) {
|
|
platform = "all";
|
|
wpt_layout = "all";
|
|
unit_tests = true;
|
|
}
|
|
|
|
let platforms = [];
|
|
if (platform == "all") {
|
|
platforms = [ "linux", "windows", "macos", "android" ];
|
|
} else {
|
|
platforms = [ platform ];
|
|
}
|
|
|
|
let returnValue = {
|
|
platforms,
|
|
wpt_layout,
|
|
unit_tests,
|
|
profile,
|
|
wpt_tests_to_run,
|
|
};
|
|
|
|
console.log("Using configuration: " + JSON.stringify(returnValue));
|
|
return returnValue;
|
|
|
|
build-win:
|
|
name: Windows
|
|
needs: ["decision"]
|
|
if: ${{ contains(fromJson(needs.decision.outputs.configuration).platforms, 'windows') }}
|
|
uses: ./.github/workflows/windows.yml
|
|
with:
|
|
profile: ${{ fromJson(needs.decision.outputs.configuration).profile }}
|
|
unit-tests: ${{ fromJson(needs.decision.outputs.configuration).unit_tests }}
|
|
secrets: inherit
|
|
|
|
build-mac:
|
|
name: Mac
|
|
needs: ["decision"]
|
|
if: ${{ contains(fromJson(needs.decision.outputs.configuration).platforms, 'macos') }}
|
|
uses: ./.github/workflows/mac.yml
|
|
with:
|
|
wpt-tests-to-run: ${{ fromJson(needs.decision.outputs.configuration).wpt_tests_to_run }}
|
|
profile: ${{ fromJson(needs.decision.outputs.configuration).profile }}
|
|
unit-tests: ${{ fromJson(needs.decision.outputs.configuration).unit_tests }}
|
|
secrets: inherit
|
|
|
|
build-linux:
|
|
name: Linux
|
|
needs: ["decision"]
|
|
if: ${{ contains(fromJson(needs.decision.outputs.configuration).platforms, 'linux') }}
|
|
uses: ./.github/workflows/linux.yml
|
|
with:
|
|
wpt-tests-to-run: ${{ fromJson(needs.decision.outputs.configuration).wpt_tests_to_run }}
|
|
profile: ${{ fromJson(needs.decision.outputs.configuration).profile }}
|
|
wpt-layout: ${{ fromJson(needs.decision.outputs.configuration).wpt_layout }}
|
|
unit-tests: ${{ fromJson(needs.decision.outputs.configuration).unit_tests }}
|
|
secrets: inherit
|
|
|
|
build-android:
|
|
name: Android
|
|
needs: ["decision"]
|
|
if: ${{ contains(fromJson(needs.decision.outputs.configuration).platforms, 'android') }}
|
|
uses: ./.github/workflows/android.yml
|
|
with:
|
|
profile: "release"
|
|
secrets: inherit
|
|
|
|
build-result:
|
|
name: Result
|
|
runs-on: ubuntu-latest
|
|
if: always()
|
|
# needs all build to detect cancellation
|
|
needs:
|
|
- "decision"
|
|
- "build-win"
|
|
- "build-mac"
|
|
- "build-linux"
|
|
- "build-android"
|
|
steps:
|
|
- name: Mark skipped jobs as successful
|
|
if: ${{ fromJson(needs.decision.outputs.configuration).platforms[0] != null }}
|
|
run: exit 0
|
|
- name: Mark the job as successful
|
|
if: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
|
|
run: exit 0
|
|
- name: Mark the job as unsuccessful
|
|
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
|
|
run: exit 1
|