mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
There is currently no way to trigger unit tests using the bors-servo try infrastructure. This change makes it so that using try-<platform> triggers unit tests for that platform. This will be especially useful when testing changes for Windows before trying to land them.
169 lines
5.5 KiB
YAML
169 lines
5.5 KiB
YAML
name: Mac workflow
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
layout:
|
|
required: true
|
|
type: string
|
|
unit-tests:
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
upload:
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
github-release-id:
|
|
required: false
|
|
type: string
|
|
workflow_dispatch:
|
|
inputs:
|
|
layout:
|
|
required: true
|
|
type: choice
|
|
options: ["2013", "2020"]
|
|
unit-tests:
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
upload:
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
push:
|
|
branches: ["try-mac"]
|
|
|
|
env:
|
|
RUST_BACKTRACE: 1
|
|
SHELL: /bin/bash
|
|
LAYOUT: "${{ contains(inputs.layout, '2020') && 'layout-2020' || 'layout-2013' }}"
|
|
PACKAGE: "${{ contains(inputs.layout, '2020') && 'mac-layout2020' || 'mac' }}"
|
|
SCCACHE_GHA_ENABLED: "true"
|
|
RUSTC_WRAPPER: "sccache"
|
|
CCACHE: "sccache"
|
|
CARGO_INCREMENTAL: 0
|
|
|
|
jobs:
|
|
build-mac:
|
|
name: Build
|
|
runs-on: macos-12
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 2
|
|
- name: Run sccache-cache
|
|
uses: mozilla-actions/sccache-action@v0.0.3
|
|
- name: Bootstrap
|
|
run: |
|
|
python3 -m pip install --upgrade pip virtualenv
|
|
python3 ./mach bootstrap
|
|
- name: Release build
|
|
run: |
|
|
python3 ./mach build --release --with-${{ env.LAYOUT }}
|
|
- name: Smoketest
|
|
run: python3 ./mach smoketest
|
|
- name: Script tests
|
|
run: ./mach test-scripts
|
|
- name: Unit tests
|
|
if: ${{ inputs.unit-tests || github.ref_name == 'try-mac' }}
|
|
run: python3 ./mach test-unit --release --with-${{ env.LAYOUT }}
|
|
- name: Package
|
|
run: python3 ./mach package --release
|
|
- name: Package smoketest
|
|
run: ./etc/ci/macos_package_smoketest.sh target/release/servo-tech-demo.dmg
|
|
- name: Rename build timing
|
|
run: cp -r target/cargo-timings target/cargo-timings-macos-${{ env.LAYOUT }}
|
|
- name: Archive build timing
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: cargo-timings
|
|
# Using a wildcard here ensures that the archive includes the path.
|
|
path: target/cargo-timings-*-${{ env.LAYOUT }}
|
|
- name: Upload package
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: ${{ env.PACKAGE }}
|
|
path: target/release/servo-tech-demo.dmg
|
|
- name: Upload
|
|
if: ${{ inputs.upload }}
|
|
run: |
|
|
python3 ./mach upload-nightly ${{ env.PACKAGE }} --secret-from-environment \
|
|
--github-release-id ${{ inputs.github-release-id }}
|
|
env:
|
|
S3_UPLOAD_CREDENTIALS: ${{ secrets.S3_UPLOAD_CREDENTIALS }}
|
|
GITHUB_HOMEBREW_TOKEN: ${{ secrets.HOMEBREW_TOKEN }}
|
|
NIGHTLY_REPO_TOKEN: ${{ secrets.NIGHTLY_REPO_TOKEN }}
|
|
NIGHTLY_REPO: ${{ github.repository_owner }}/servo-nightly-builds
|
|
- name: Package binary
|
|
run: gtar -czf target.tar.gz target/release/servo target/release/*.dylib resources
|
|
- name: Archive binary
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: release-${{ env.LAYOUT }}-binary-macos
|
|
path: target.tar.gz
|
|
|
|
# mac-wpt:
|
|
# name: Mac WPT Tests
|
|
# runs-on: macos-12
|
|
# needs: ["build-mac"]
|
|
# env:
|
|
# max_chunk_id: 20
|
|
# strategy:
|
|
# fail-fast: false
|
|
# matrix:
|
|
# chunk_id: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
|
|
# steps:
|
|
# - uses: actions/checkout@v3
|
|
# with:
|
|
# fetch-depth: 2
|
|
# - uses: actions/download-artifact@v3
|
|
# with:
|
|
# name: release-binary-macos
|
|
# # TODO: Remove this step when the compatibility issue between mozjs and
|
|
# # Homebrew's Python 3.10 formula (servo/rust-mozjs#559) is fixed
|
|
# - name: Select Python 3.9
|
|
# run: |
|
|
# brew install python@3.9
|
|
# cd $(dirname $(which python3.9))
|
|
# rm -f python3 pip3
|
|
# ln -s python3.9 python3
|
|
# ln -s pip3.9 pip3
|
|
# - name: Prep test environment
|
|
# run: |
|
|
# gtar -xzf target.tar.gz
|
|
# python3 -m pip install --upgrade pip virtualenv
|
|
# brew bundle install --verbose --no-upgrade --file=etc/homebrew/Brewfile
|
|
# - name: Smoketest
|
|
# run: python3 ./mach smoketest
|
|
# - name: Run tests
|
|
# run: |
|
|
# python3 ./mach test-wpt \
|
|
# --release --processes $(sysctl -n hw.logicalcpu) --timeout-multiplier 8 \
|
|
# --total-chunks ${{ env.max_chunk_id }} --this-chunk ${{ matrix.chunk_id }} \
|
|
# --log-raw test-wpt.${{ matrix.chunk_id }}.log \
|
|
# --filter-intermittents=filtered-wpt-summary.${{ matrix.chunk_id }}.log
|
|
# - name: Archive logs
|
|
# uses: actions/upload-artifact@v3
|
|
# if: ${{ failure() }}
|
|
# with:
|
|
# name: wpt${{ matrix.chunk_id }}-logs-macos
|
|
# path: |
|
|
# test-wpt.${{ matrix.chunk_id }}.log
|
|
# filtered-wpt-summary.${{ matrix.chunk_id }}.log
|
|
|
|
build_result:
|
|
name: homu build finished
|
|
runs-on: ubuntu-latest
|
|
if: always()
|
|
# needs all build to detect cancellation
|
|
needs:
|
|
- "build-mac"
|
|
|
|
steps:
|
|
- name: Mark the job as successful
|
|
run: exit 0
|
|
if: ${{ !contains(join(needs.*.result, ','), 'failure') && !contains(join(needs.*.result, ','), 'cancelled') }}
|
|
- name: Mark the job as unsuccessful
|
|
run: exit 1
|
|
if: contains(join(needs.*.result, ','), 'failure') || contains(join(needs.*.result, ','), 'cancelled')
|