mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Triggering from labels means that we have less actions running and less false job failures spamming project members. Plus, we have more flexibility with labels rather than the backward compatibility we have set up for bors comments.
137 lines
4.8 KiB
YAML
137 lines
4.8 KiB
YAML
name: Windows
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
production:
|
|
required: false
|
|
type: boolean
|
|
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:
|
|
production:
|
|
required: false
|
|
type: boolean
|
|
unit-tests:
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
upload:
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
push:
|
|
branches: ["try-windows"]
|
|
|
|
env:
|
|
cargo_profile_option: ${{ inputs.production && '--profile production' || '--release' }}
|
|
cargo_profile_name: ${{ inputs.production && 'production' || 'release' }}
|
|
RUST_BACKTRACE: 1
|
|
SHELL: /bin/bash
|
|
CCACHE: "ccache"
|
|
CARGO_TARGET_DIR: C:\\a\\servo\\servo\\target
|
|
# clang_sys will search msys path before Program Files\LLVM
|
|
# so we need to override this behaviour until we update clang-sys
|
|
# https://github.com/KyleMayes/clang-sys/issues/150
|
|
LIBCLANG_PATH: C:\\Program Files\\LLVM\\bin
|
|
|
|
jobs:
|
|
build:
|
|
name: Windows Build
|
|
runs-on: windows-2019
|
|
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: ccache
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
- name: Install taplo
|
|
uses: baptiste0928/cargo-install@v2
|
|
with:
|
|
crate: taplo-cli
|
|
locked: true
|
|
- name: Install wixtoolset
|
|
run: |
|
|
choco install wixtoolset
|
|
echo "C:\\Program Files (x86)\\WiX Toolset v3.11\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
|
- name: Bootstrap
|
|
run: |
|
|
python -m pip install --upgrade pip virtualenv
|
|
python mach fetch
|
|
python mach bootstrap-gstreamer
|
|
- name: Release build (${{ inputs.production && 'without' || 'with' }} debug assertions)
|
|
run: python mach build ${{ env.cargo_profile_option }}
|
|
- name: Copy resources
|
|
run: cp D:\a\servo\servo\resources C:\a\servo\servo -Recurse
|
|
- name: Smoketest
|
|
run: python mach smoketest --angle ${{ env.cargo_profile_option }}
|
|
- name: Unit tests
|
|
if: ${{ inputs.unit-tests || github.ref_name == 'try-windows' }}
|
|
uses: nick-fields/retry@v2
|
|
with:
|
|
timeout_minutes: 30
|
|
max_attempts: 3 # https://github.com/servo/servo/issues/30683
|
|
command: python mach test-unit ${{ env.cargo_profile_option }} -- -- --test-threads=1
|
|
- name: Rename build timing
|
|
run: cp C:\a\servo\servo\target\cargo-timings C:\a\servo\servo\target\cargo-timings-windows -Recurse
|
|
- 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: C:\\a\\servo\\servo\\target\\cargo-timings-*
|
|
- name: Build mach package
|
|
run: python mach package ${{ env.cargo_profile_option }}
|
|
- name: Upload artifact for mach package
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: win
|
|
# These files are available
|
|
# MSI Installer: C:\a\servo\servo\target\${{ env.cargo_profile_name }}\msi\Installer.msi
|
|
# Bundle: C:\a\servo\servo\target\${{ env.cargo_profile_name }}\msi\Servo.exe
|
|
# Zip: C:\a\servo\servo\target\${{ env.cargo_profile_name }}\msi\Servo.zip
|
|
path: C:\\a\\servo\\servo\\target\\${{ env.cargo_profile_name }}\\msi\\Servo.exe
|
|
- name: Upload nightly
|
|
if: ${{ inputs.upload }}
|
|
run: |
|
|
python mach upload-nightly windows-msvc --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
|
|
|
|
result:
|
|
name: Result
|
|
runs-on: ubuntu-latest
|
|
if: always()
|
|
# needs all build to detect cancellation
|
|
needs:
|
|
- "build"
|
|
|
|
steps:
|
|
- name: Mark the job as successful
|
|
run: exit 0
|
|
if: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
|
|
- name: Mark the job as unsuccessful
|
|
run: exit 1
|
|
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
|
|
|