mirror of
https://github.com/servo/servo
synced 2026-05-05 06:32:13 +02:00
238 lines
8.4 KiB
YAML
238 lines
8.4 KiB
YAML
name: Linux workflow
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
wpt:
|
|
required: false
|
|
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:
|
|
wpt:
|
|
default: "test"
|
|
required: false
|
|
type: choice
|
|
options: ["test", "sync"]
|
|
unit-tests:
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
upload:
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
push:
|
|
branches: ["try-linux", "try-wpt", "try-wpt-2020"]
|
|
|
|
env:
|
|
RUST_BACKTRACE: 1
|
|
SHELL: /bin/bash
|
|
SCCACHE_GHA_ENABLED: "true"
|
|
RUSTC_WRAPPER: "sccache"
|
|
CCACHE: "sccache"
|
|
CARGO_INCREMENTAL: 0
|
|
|
|
jobs:
|
|
build-linux:
|
|
name: Build
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 2
|
|
- name: Run sccache-cache
|
|
uses: mozilla-actions/sccache-action@v0.0.3
|
|
- name: Select Python 3.9
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.9'
|
|
- name: Bootstrap Python
|
|
run: python3 -m pip install --upgrade pip virtualenv
|
|
- name: Bootstrap dependencies
|
|
run: sudo apt update && python3 ./mach bootstrap
|
|
- name: Tidy
|
|
run: python3 ./mach test-tidy --no-progress --all
|
|
- name: Release build
|
|
run: python3 ./mach build --release
|
|
- name: Smoketest
|
|
run: xvfb-run python3 ./mach smoketest
|
|
- name: Script tests
|
|
run: ./mach test-scripts
|
|
- name: Unit tests
|
|
if: ${{ inputs.unit-tests || github.ref_name == 'try-linux' }}
|
|
run: python3 ./mach test-unit --release
|
|
- name: Rename build timing
|
|
run: cp -r target/cargo-timings target/cargo-timings-linux
|
|
- 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-*
|
|
- name: Lockfile check
|
|
run: ./etc/ci/lockfile_changed.sh
|
|
- name: Package
|
|
run: python3 ./mach package --release
|
|
- name: Upload Package
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: linux
|
|
path: target/release/servo-tech-demo.tar.gz
|
|
- name: Upload
|
|
if: ${{ inputs.upload }}
|
|
run: |
|
|
python3 ./mach upload-nightly linux \
|
|
--secret-from-environment \
|
|
--github-release-id ${{ inputs.github-release-id }}
|
|
env:
|
|
S3_UPLOAD_CREDENTIALS: ${{ secrets.S3_UPLOAD_CREDENTIALS }}
|
|
NIGHTLY_REPO_TOKEN: ${{ secrets.NIGHTLY_REPO_TOKEN }}
|
|
NIGHTLY_REPO: ${{ github.repository_owner }}/servo-nightly-builds
|
|
- name: Package binary
|
|
run: tar -czf target.tar.gz target/release/servo resources
|
|
- name: Archive binary
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: release-binary
|
|
path: target.tar.gz
|
|
|
|
linux-wpt:
|
|
if: ${{ github.ref_name == 'try-wpt' || github.ref_name == 'try-wpt-2020' || inputs.wpt }}
|
|
name: Linux WPT Tests
|
|
runs-on: ubuntu-20.04
|
|
needs: ["build-linux"]
|
|
env:
|
|
max_chunk_id: 20
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
layout: ["layout-2020", "layout-2013"]
|
|
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
|
|
path: release-binary
|
|
- name: unPackage binary
|
|
run: tar -xzf release-binary/target.tar.gz
|
|
- name: Prep test environment
|
|
run: |
|
|
python3 -m pip install --upgrade pip virtualenv
|
|
sudo apt update
|
|
sudo apt install -qy --no-install-recommends libgl1 libssl1.1 libdbus-1-3 libxcb-xfixes0-dev libxcb-shape0-dev libunwind8 libegl1-mesa
|
|
wget http://mirrors.kernel.org/ubuntu/pool/main/libf/libffi/libffi6_3.2.1-8_amd64.deb
|
|
sudo apt install ./libffi6_3.2.1-8_amd64.deb
|
|
python3 ./mach bootstrap-gstreamer
|
|
- name: Fetch upstream changes before testing
|
|
if: ${{ inputs.wpt == 'sync' }}
|
|
run: |
|
|
./etc/ci/update-wpt-checkout fetch-upstream-changes
|
|
- name: Run tests
|
|
if: ${{ inputs.wpt != 'sync' }}
|
|
run: |
|
|
python3 ./mach test-wpt --with-${{ matrix.layout }} \
|
|
--release --processes $(nproc) --timeout-multiplier 2 \
|
|
--total-chunks ${{ env.max_chunk_id }} --this-chunk ${{ matrix.chunk_id }} \
|
|
--log-raw test-wpt-${{ matrix.layout }}.${{ matrix.chunk_id }}.log \
|
|
--log-raw-unexpected unexpected-test-wpt-${{ matrix.layout }}.${{ matrix.chunk_id }}.log \
|
|
--filter-intermittents filtered-test-wpt-${{ matrix.layout }}.${{ matrix.chunk_id }}.json
|
|
env:
|
|
GITHUB_CONTEXT: ${{ toJson(github) }}
|
|
INTERMITTENT_TRACKER_DASHBOARD_SECRET: ${{ secrets.INTERMITTENT_TRACKER_DASHBOARD_SECRET }}
|
|
- name: Run tests (sync)
|
|
if: ${{ inputs.wpt == 'sync' }}
|
|
run: |
|
|
python3 ./mach test-wpt --with-${{ matrix.layout }} \
|
|
--release --processes $(nproc) --timeout-multiplier 2 \
|
|
--total-chunks ${{ env.max_chunk_id }} --this-chunk ${{ matrix.chunk_id }} \
|
|
--log-raw test-wpt.${{ matrix.chunk_id }}.log \
|
|
--always-succeed
|
|
- name: Archive filtered results
|
|
uses: actions/upload-artifact@v3
|
|
if: ${{ always() && inputs.wpt != 'sync' }}
|
|
with:
|
|
name: wpt-filtered-results-linux
|
|
path: |
|
|
filtered-test-wpt-${{ matrix.layout }}.${{ matrix.chunk_id }}.json
|
|
unexpected-test-wpt-${{ matrix.layout }}.${{ matrix.chunk_id }}.log
|
|
- name: Archive logs
|
|
uses: actions/upload-artifact@v3
|
|
if: ${{ failure() && inputs.wpt != 'sync' }}
|
|
with:
|
|
name: wpt-logs-linux
|
|
path: |
|
|
test-wpt-${{ matrix.layout }}.${{ matrix.chunk_id }}.log
|
|
- name: Archive logs
|
|
uses: actions/upload-artifact@v3
|
|
if: ${{ inputs.wpt == 'sync' }}
|
|
with:
|
|
name: wpt-logs-linux-${{ matrix.layout }}
|
|
path: |
|
|
test-wpt.${{ matrix.chunk_id }}.log
|
|
wpt-jsonsummary.${{ matrix.chunk_id }}.log
|
|
|
|
report-test-results:
|
|
name: Reporting test results
|
|
runs-on: ubuntu-latest
|
|
if: ${{ always() && !cancelled() && success('build-linux') && (github.ref_name == 'try-wpt' || github.ref_name == 'try-wpt-2020' || inputs.wpt == 'test') }}
|
|
needs:
|
|
- "linux-wpt"
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 2
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: wpt-filtered-results-linux
|
|
path: wpt-filtered-results-linux
|
|
- name: Create aggregated unexpected results
|
|
run: |
|
|
cat wpt-filtered-results-linux/*-layout-2020.*.log > unexpected-test-wpt-layout-2020.log
|
|
cat wpt-filtered-results-linux/*-layout-2013.*.log > unexpected-test-wpt-layout-2013.log
|
|
- name: Archive aggregate results
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: wpt-filtered-results-linux
|
|
path: |
|
|
unexpected-test-wpt-layout-2020.log
|
|
unexpected-test-wpt-layout-2013.log
|
|
- name: Comment on PR with results
|
|
run: |
|
|
etc/ci/report_aggregated_expected_results.py --tag="linux-wpt-2020" wpt-filtered-results-linux/*-layout-2020.*.json
|
|
etc/ci/report_aggregated_expected_results.py --tag="linux-wpt-2013" wpt-filtered-results-linux/*-layout-2013.*.json
|
|
env:
|
|
GITHUB_CONTEXT: ${{ toJson(github) }}
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
RESULTS: ${{ toJson(needs.*.result) }}
|
|
|
|
build_result:
|
|
name: homu build finished
|
|
runs-on: ubuntu-latest
|
|
if: always()
|
|
# needs all build to detect cancellation
|
|
needs:
|
|
- "build-linux"
|
|
- "linux-wpt"
|
|
- "report-test-results"
|
|
|
|
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')
|