mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
177 lines
5.6 KiB
YAML
177 lines
5.6 KiB
YAML
name: Linux
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
profile:
|
|
required: false
|
|
default: "release"
|
|
type: string
|
|
wpt-tests-to-run:
|
|
default: ""
|
|
required: false
|
|
type: string
|
|
wpt-sync-from-upstream:
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
wpt-layout:
|
|
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:
|
|
profile:
|
|
required: false
|
|
default: "release"
|
|
type: choice
|
|
options: ["release", "debug", "production"]
|
|
wpt-tests-to-run:
|
|
default: ""
|
|
required: false
|
|
type: string
|
|
wpt-sync-from-upstream:
|
|
default: false
|
|
required: false
|
|
type: boolean
|
|
wpt-layout:
|
|
required: false
|
|
type: choice
|
|
options: ["none", "2013", "2020", "all"]
|
|
unit-tests:
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
upload:
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
|
|
env:
|
|
RUST_BACKTRACE: 1
|
|
SHELL: /bin/bash
|
|
SCCACHE_GHA_ENABLED: "true"
|
|
CCACHE: "sccache"
|
|
CARGO_INCREMENTAL: 0
|
|
|
|
jobs:
|
|
build:
|
|
name: Linux Build
|
|
# Ubuntu 22.04 has glibc 2.34 so the binaries produced
|
|
# won't run on systems with older glibc e.g wpt.fyi
|
|
# runners which still use 20.04.
|
|
runs-on: ubuntu-${{ inputs.upload && '20.04' || '22.04' }}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
if: github.event_name != 'pull_request_target'
|
|
with:
|
|
fetch-depth: 2
|
|
# This is necessary to checkout the pull request if this run was triggered via a
|
|
# `pull_request_target` event.
|
|
- uses: actions/checkout@v3
|
|
if: github.event_name == 'pull_request_target'
|
|
with:
|
|
ref: refs/pull/${{ github.event.number }}/head
|
|
fetch-depth: 2
|
|
- name: Run sccache-cache
|
|
uses: mozilla-actions/sccache-action@v0.0.3
|
|
- name: Set LIBCLANG_PATH env # needed for bindgen in mozangle
|
|
if: ${{ !inputs.upload }} # not needed on ubuntu 20.04 used for nightly
|
|
run: echo "LIBCLANG_PATH=/usr/lib/llvm-14/lib" >> $GITHUB_ENV
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.10'
|
|
- name: Install taplo
|
|
uses: baptiste0928/cargo-install@v2
|
|
with:
|
|
crate: taplo-cli
|
|
locked: true
|
|
cache-key: ${{ inputs.upload && '20.04' || '22.04' }}
|
|
- name: Bootstrap Python
|
|
run: python3 -m pip install --upgrade pip
|
|
- name: Bootstrap dependencies
|
|
run: |
|
|
sudo apt update
|
|
python3 ./mach bootstrap
|
|
- name: Tidy
|
|
run: python3 ./mach test-tidy --no-progress --all
|
|
- name: Build (${{ inputs.profile }})
|
|
run: python3 ./mach build --${{ inputs.profile }}
|
|
- name: Smoketest
|
|
run: xvfb-run python3 ./mach smoketest --${{ inputs.profile }}
|
|
- name: Script tests
|
|
run: ./mach test-scripts
|
|
- name: Unit tests
|
|
if: ${{ inputs.unit-tests }}
|
|
uses: nick-fields/retry@v2
|
|
with:
|
|
timeout_minutes: 20
|
|
max_attempts: 2 # https://github.com/servo/servo/issues/30683
|
|
command: python ./mach test-unit --${{ inputs.profile }}
|
|
- 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: Build mach package
|
|
run: python3 ./mach package --${{ inputs.profile }}
|
|
- name: Upload artifact for mach package
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: linux
|
|
path: target/${{ inputs.profile }}/servo-tech-demo.tar.gz
|
|
- name: Upload nightly
|
|
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: Build package for target
|
|
run: tar -czf target.tar.gz target/${{ inputs.profile }}/servo resources
|
|
- name: Upload artifact for target
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: release-binary
|
|
path: target.tar.gz
|
|
|
|
wpt-2020:
|
|
if: ${{ inputs.wpt-layout == '2020' || inputs.wpt-layout == 'all' }}
|
|
name: Linux WPT
|
|
needs: ["build"]
|
|
uses: ./.github/workflows/linux-wpt.yml
|
|
with:
|
|
wpt-tests-to-run: ${{ inputs.wpt-tests-to-run }}
|
|
profile: ${{ inputs.profile }}
|
|
wpt-sync-from-upstream: ${{ inputs.wpt-sync-from-upstream }}
|
|
wpt-layout: "layout-2020"
|
|
secrets: inherit
|
|
|
|
wpt-2013:
|
|
if: ${{ inputs.wpt-layout == '2013' || inputs.wpt-layout == 'all' }}
|
|
name: Linux WPT (Legacy)
|
|
needs: ["build"]
|
|
uses: ./.github/workflows/linux-wpt.yml
|
|
with:
|
|
wpt-tests-to-run: ${{ inputs.wpt-tests-to-run }}
|
|
profile: ${{ inputs.profile }}
|
|
wpt-sync-from-upstream: ${{ inputs.wpt-sync-from-upstream }}
|
|
wpt-layout: "layout-2013"
|
|
secrets: inherit
|