mirror of
https://github.com/servo/servo
synced 2026-04-25 17:15:48 +02:00
This should help clarify the difference between servo the library / engine and servoshell the browser (demo). Other changes: - Removed etc/servo.sb ( [apple sandbox profile format](https://angelica.gitbook.io/hacktricks/macos-hardening/macos-security-and-privilege-escalation/macos-security-protections/macos-sandbox#sandbox-profiles)) since it is not needed anymore. See [this comment](https://github.com/servo/servo/pull/42958#discussion_r2876253489) for more details. Testing: This is a very invasive change, and there are bound to be scripts / places I have overlooked. Searching for usages of `servo` is very hard, since it's also the name of the library. Try run: https://github.com/servo/servo/actions/runs/22637676818 --------- Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
258 lines
9.0 KiB
YAML
258 lines
9.0 KiB
YAML
name: MacOS
|
|
|
|
on:
|
|
workflow_call:
|
|
outputs:
|
|
artifact_ids:
|
|
value: ${{ jobs.build.outputs.artifact_ids }}
|
|
description: Comma-separated list of artifact IDs for the release artifacts
|
|
inputs:
|
|
profile:
|
|
required: false
|
|
default: "release"
|
|
type: string
|
|
build-args:
|
|
default: ""
|
|
required: false
|
|
type: string
|
|
wpt-args:
|
|
default: ""
|
|
required: false
|
|
type: string
|
|
wpt:
|
|
required: false
|
|
type: boolean
|
|
unit-tests:
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
build-libservo:
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
force-github-hosted-runner:
|
|
required: false
|
|
type: boolean
|
|
default: false
|
|
bencher:
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
workflow_dispatch:
|
|
inputs:
|
|
profile:
|
|
required: false
|
|
default: "release"
|
|
type: choice
|
|
options: ["release", "debug", "production"]
|
|
wpt-args:
|
|
default: ""
|
|
required: false
|
|
type: string
|
|
wpt:
|
|
required: false
|
|
type: boolean
|
|
unit-tests:
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
build-libservo:
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
force-github-hosted-runner:
|
|
required: false
|
|
type: boolean
|
|
default: false
|
|
bencher:
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
|
|
env:
|
|
RUST_BACKTRACE: 1
|
|
SHELL: /bin/bash
|
|
CARGO_INCREMENTAL: 0
|
|
|
|
jobs:
|
|
# Runs the underlying job (“workload”) on a self-hosted runner if available,
|
|
# with the help of a `runner-select` job and a `runner-timeout` job.
|
|
runner-select:
|
|
runs-on: ubuntu-24.04
|
|
outputs:
|
|
unique-id: ${{ steps.select.outputs.unique-id }}
|
|
selected-runner-label: ${{ steps.select.outputs.selected-runner-label }}
|
|
runner-type-label: ${{ steps.select.outputs.runner-type-label }}
|
|
is-self-hosted: ${{ steps.select.outputs.is-self-hosted }}
|
|
steps:
|
|
- name: Runner select
|
|
id: select
|
|
uses: servo/ci-runners/actions/runner-select@6d88b19dda997f1ce2a11e4c1c34717c2bbcafba
|
|
with:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
github-hosted-runner-label: macos-15-intel
|
|
self-hosted-image-name: servo-macos13
|
|
# You can disable self-hosted runners globally by creating a repository variable named
|
|
# NO_SELF_HOSTED_RUNNERS with any non-empty value.
|
|
# <https://github.com/servo/servo/settings/variables/actions>
|
|
NO_SELF_HOSTED_RUNNERS: ${{ vars.NO_SELF_HOSTED_RUNNERS }}
|
|
# Any other boolean conditions that disable self-hosted runners go here.
|
|
force-github-hosted-runner: ${{ inputs.force-github-hosted-runner }}
|
|
|
|
build:
|
|
needs:
|
|
- runner-select
|
|
name: MacOS Build [${{ needs.runner-select.outputs.unique-id }}]
|
|
runs-on: ${{ needs.runner-select.outputs.selected-runner-label }}
|
|
outputs:
|
|
artifact_ids: ${{ steps.artifact_ids.outputs.artifact_ids }}
|
|
steps:
|
|
# XProtect can cause random failures if it decides that the DMG we create
|
|
# during the packaging phase is malware.
|
|
# TODO(mrobinson): Is there a way we can do things in a less suspicious way so
|
|
# we don't have to kill this service?
|
|
- name: Kill XProtectBehaviorService
|
|
run: |
|
|
echo Killing XProtect.; sudo pkill -9 XProtect >/dev/null || true;
|
|
- uses: servo/ci-runners/actions/checkout@6d88b19dda997f1ce2a11e4c1c34717c2bbcafba
|
|
|
|
- if: runner.environment != 'self-hosted'
|
|
name: Setup Python
|
|
uses: ./.github/actions/setup-python
|
|
|
|
# Always install crown, even on self-hosted runners, because it is tightly
|
|
# coupled to the rustc version, and we may have the wrong version if the
|
|
# commit we are building uses a different rustc version.
|
|
- name: Install crown
|
|
run: cargo install --path support/crown
|
|
|
|
- uses: taiki-e/install-action@v2
|
|
with:
|
|
tool: nextest
|
|
|
|
- if: runner.environment != 'self-hosted'
|
|
name: Bootstrap
|
|
run: |
|
|
./mach bootstrap --yes --skip-lints
|
|
brew install gnu-tar
|
|
- name: Build (${{ inputs.profile }})
|
|
run: |
|
|
./mach build --use-crown --locked --profile ${{ inputs.profile }} ${{ inputs.build-args }}
|
|
cp -r target/cargo-timings target/cargo-timings-macos
|
|
- name: Smoketest
|
|
uses: nick-fields/retry@v3
|
|
with: # See https://github.com/servo/servo/issues/30757
|
|
timeout_minutes: 5
|
|
max_attempts: 2
|
|
command: ./mach smoketest --profile ${{ inputs.profile }}
|
|
- name: Script tests
|
|
run: ./mach test-scripts
|
|
- name: Unit tests
|
|
if: ${{ inputs.unit-tests }}
|
|
id: run_unit_tests
|
|
env:
|
|
NEXTEST_RETRIES: 3 # https://github.com/servo/servo/issues/30683
|
|
run: ./mach test-unit --profile ${{ inputs.profile }} --nextest-profile ci
|
|
# We upload the test-results to Codecov to help us identify flaky unit-tests.
|
|
- name: Upload test results to Codecov
|
|
# Upload test results to Codecov, also for failed unit-tests, but only
|
|
# if unit-tests were supposed to run, and not if they were skipped (e.g., due
|
|
# to an earlier failure).
|
|
if: ${{ !cancelled() && steps.run_unit_tests.conclusion != 'skipped' }}
|
|
uses: codecov/codecov-action@v5
|
|
with:
|
|
report_type: test_results
|
|
files: target/nextest/ci/junit.xml
|
|
disable_search: true
|
|
flags: unittests,unittests-mac,unittests-mac-${{ inputs.profile }}
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
- name: Devtools tests
|
|
if: ${{ false && inputs.unit-tests }} # FIXME #39273
|
|
run: ./mach test-devtools --profile ${{ inputs.profile }}
|
|
- name: Build mach package
|
|
run: ./mach package --profile ${{ inputs.profile }}
|
|
- name: Run DMG smoketest
|
|
uses: nick-fields/retry@v3
|
|
with: # See https://github.com/servo/servo/issues/30757
|
|
timeout_minutes: 5
|
|
max_attempts: 2
|
|
command: ./etc/ci/macos_package_smoketest.sh target/${{ inputs.profile }}/servo-tech-demo.dmg
|
|
- name: Archive build timing
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: cargo-timings-macos-${{ inputs.profile }}
|
|
# Using a wildcard here ensures that the archive includes the path.
|
|
path: target/cargo-timings-*
|
|
- name: Upload artifact for mach package
|
|
uses: actions/upload-artifact@v6
|
|
id: upload-dmg
|
|
with:
|
|
name: ${{ inputs.profile }}-binary-mac
|
|
path: target/${{ inputs.profile }}/servo-tech-demo.dmg
|
|
- name: Collect artifact IDs needed by the release workflow
|
|
id: artifact_ids
|
|
shell: bash
|
|
run: |
|
|
echo "artifact_ids=${{ steps.upload-dmg.outputs.artifact-id }}" >> $GITHUB_OUTPUT
|
|
- name: Build package for target
|
|
run: gtar -czf target.tar.gz target/${{ inputs.profile }}/servoshell target/${{ inputs.profile }}/lib/*.dylib resources
|
|
- name: Upload package for target
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: ${{ inputs.profile }}-binary-macos
|
|
path: target.tar.gz
|
|
|
|
wpt-2020:
|
|
if: ${{ inputs.wpt }}
|
|
name: MacOS WPT
|
|
needs: ["build"]
|
|
uses: ./.github/workflows/mac-wpt.yml
|
|
with:
|
|
profile: ${{ inputs.profile }}
|
|
wpt-args: ${{ inputs.wpt-args }}
|
|
arm: false
|
|
secrets: inherit
|
|
|
|
bencher:
|
|
needs: ["build"]
|
|
if: ${{ inputs.bencher && inputs.profile != 'debug' && github.event_name != 'workflow_dispatch' && github.event_name != 'merge_group' }}
|
|
uses: ./.github/workflows/bencher.yml
|
|
with:
|
|
target: 'macos'
|
|
profile: ${{ inputs.profile }}
|
|
compressed-file-path: ${{ inputs.profile }}-binary-macos/target.tar.gz
|
|
binary-path: target/${{ inputs.profile }}/servoshell
|
|
file-size: true
|
|
speedometer: false
|
|
dromaeo: false
|
|
secrets: inherit
|
|
|
|
build-libservo:
|
|
if: ${{ inputs.build-libservo }}
|
|
name: Build libservo and MSRV check
|
|
runs-on: macos-15-intel
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
if: github.event_name != 'pull_request_target'
|
|
with:
|
|
fetch-depth: 1
|
|
# This is necessary to checkout the pull request if this run was triggered via a
|
|
# `pull_request_target` event.
|
|
- uses: actions/checkout@v5
|
|
if: github.event_name == 'pull_request_target'
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
fetch-depth: 1
|
|
- name: Setup Python
|
|
uses: ./.github/actions/setup-python
|
|
- name: Determine MSRV
|
|
id: msrv
|
|
uses: ./.github/actions/parse_msrv
|
|
- name: Install MSRV
|
|
uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: ${{ steps.msrv.outputs.rust_version }}
|
|
- name: Compile libservo with MSRV
|
|
run: |
|
|
cargo +${{ steps.msrv.outputs.rust_version }} build -p libservo --locked --all-targets
|