mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
LLVM is the largest package that we get from servo-build-deps, so installing it via chocolatey should reduce the amount of data that we transfer from that source. In addition, it's one less dependency that we have to manage. It also seems that installing LLVM to the default location with choco means that we no longer have to set the LIBCLANG_PATH environment variable for bindgen. Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
118 lines
4 KiB
YAML
118 lines
4 KiB
YAML
name: Windows
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
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:
|
|
unit-tests:
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
upload:
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
|
|
env:
|
|
RUST_BACKTRACE: 1
|
|
SHELL: /bin/bash
|
|
CCACHE: "ccache"
|
|
CARGO_TARGET_DIR: C:\\a\\servo\\servo\\target
|
|
|
|
jobs:
|
|
build:
|
|
name: Windows Build
|
|
runs-on: windows-2019
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
if: github.event_name != 'issue_comment'
|
|
with:
|
|
fetch-depth: 2
|
|
# This is necessary to checkout the pull request if this run was triggered
|
|
# via an `issue_comment` action on a pull request.
|
|
- uses: actions/checkout@v3
|
|
if: github.event_name == 'issue_comment'
|
|
with:
|
|
ref: refs/pull/${{ github.event.issue.number }}/head
|
|
fetch-depth: 2
|
|
- name: wix311-binaries
|
|
shell: powershell
|
|
run: |
|
|
Start-BitsTransfer -Source https://github.com/wixtoolset/wix3/releases/download/wix3111rtm/wix311-binaries.zip -Destination C:\\wix311-binaries.zip
|
|
Expand-Archive C:\\wix311-binaries.zip -DestinationPath C:\\wix
|
|
echo "C:\\wix" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
|
- name: Remove msys from PATH # see https://github.com/actions/runner-images/issues/2208
|
|
run: Remove-Item -LiteralPath "C:\msys64\" -Force -Recurse
|
|
- name: ccache
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
- name: Bootstrap
|
|
run: |
|
|
python -m pip install --upgrade pip virtualenv
|
|
python mach fetch
|
|
python mach bootstrap-gstreamer
|
|
- name: Release build
|
|
run: python mach build --release
|
|
- name: Copy resources
|
|
run: cp D:\a\servo\servo\resources C:\a\servo\servo -Recurse
|
|
- name: Smoketest
|
|
run: python mach smoketest --angle --release
|
|
- name: Unit tests
|
|
if: ${{ inputs.unit-tests }}
|
|
run: python mach test-unit --release
|
|
- 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: Package
|
|
run: python mach package --release
|
|
- name: Upload package
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: win
|
|
# These files are available
|
|
# MSI Installer: C:\a\servo\servo\target\release\msi\Installer.msi
|
|
# Bundle: C:\a\servo\servo\target\release\msi\Servo.exe
|
|
# Zip: C:\a\servo\servo\target\release\msi\Servo.zip
|
|
path: C:\\a\\servo\\servo\\target/release/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')
|
|
|