Auto merge of #29596 - sagudev:release-all, r=mukilan

Package in platform workflows & nightly switch to them

Packaging takes only 1min per OS which I think it is reasonable tradeoff.

Nightly builds are also getting speed up due to sccache.
This commit is contained in:
bors-servo 2023-04-10 16:22:18 +02:00 committed by GitHub
commit f28f68eb25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 122 additions and 114 deletions

View file

@ -12,6 +12,10 @@ on:
required: false required: false
default: false default: false
type: boolean type: boolean
upload:
required: false
default: false
type: boolean
workflow_dispatch: workflow_dispatch:
inputs: inputs:
layout: layout:
@ -27,6 +31,10 @@ on:
required: false required: false
default: false default: false
type: boolean type: boolean
upload:
required: false
default: false
type: boolean
push: push:
branches: ["try-linux", "try-wpt"] branches: ["try-linux", "try-wpt"]
@ -34,6 +42,7 @@ env:
RUST_BACKTRACE: 1 RUST_BACKTRACE: 1
SHELL: /bin/bash SHELL: /bin/bash
LAYOUT: "${{ contains(inputs.layout, '2020') && 'layout-2020' || 'layout-2013' }}" LAYOUT: "${{ contains(inputs.layout, '2020') && 'layout-2020' || 'layout-2013' }}"
PACKAGE: "${{ contains(inputs.layout, '2020') && 'linux-layout2020' || 'linux' }}"
SCCACHE_GHA_ENABLED: "true" SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache" RUSTC_WRAPPER: "sccache"
CCACHE: "sccache" CCACHE: "sccache"
@ -41,7 +50,6 @@ env:
jobs: jobs:
build-linux: build-linux:
if: github.repository == 'servo/servo' || github.event_name == 'push'
name: Build name: Build
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:
@ -65,6 +73,18 @@ jobs:
run: python3 ./mach test-unit --release --with-${{ env.LAYOUT }} run: python3 ./mach test-unit --release --with-${{ env.LAYOUT }}
- name: Lockfile check - name: Lockfile check
run: ./etc/ci/lockfile_changed.sh run: ./etc/ci/lockfile_changed.sh
- name: Package
run: python3 ./mach package --release
- name: Upload Package
uses: actions/upload-artifact@v3
with:
name: ${{ env.PACKAGE }}
path: target/release/servo-tech-demo.tar.gz
- name: Upload
if: ${{ inputs.upload }}
run: python3 ./mach upload-nightly ${{ env.PACKAGE }} --secret-from-environment
env:
S3_UPLOAD_CREDENTIALS: ${{ secrets.S3_UPLOAD_CREDENTIALS }}
- name: Package binary - name: Package binary
run: tar -czf target.tar.gz target/release/servo resources run: tar -czf target.tar.gz target/release/servo resources
- name: Archive binary - name: Archive binary

View file

@ -6,12 +6,28 @@ on:
layout: layout:
required: true required: true
type: string type: string
unit-tests:
required: false
default: false
type: boolean
upload:
required: false
default: false
type: boolean
workflow_dispatch: workflow_dispatch:
inputs: inputs:
layout: layout:
required: true required: true
type: choice type: choice
options: ["2013", "2020"] options: ["2013", "2020"]
unit-tests:
required: false
default: false
type: boolean
upload:
required: false
default: false
type: boolean
push: push:
branches: ["try-mac"] branches: ["try-mac"]
@ -19,6 +35,7 @@ env:
RUST_BACKTRACE: 1 RUST_BACKTRACE: 1
SHELL: /bin/bash SHELL: /bin/bash
LAYOUT: "${{ contains(inputs.layout, '2020') && 'layout-2020' || 'layout-2013' }}" LAYOUT: "${{ contains(inputs.layout, '2020') && 'layout-2020' || 'layout-2013' }}"
PACKAGE: "${{ contains(inputs.layout, '2020') && 'mac-layout2020' || 'mac' }}"
SCCACHE_GHA_ENABLED: "true" SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache" RUSTC_WRAPPER: "sccache"
CCACHE: "sccache" CCACHE: "sccache"
@ -61,11 +78,23 @@ jobs:
- name: Smoketest - name: Smoketest
run: python3 ./mach smoketest run: python3 ./mach smoketest
- name: Unit tests - name: Unit tests
if: ${{ inputs.unit-tests }}
run: python3 ./mach test-unit --release --with-${{ env.LAYOUT }} run: python3 ./mach test-unit --release --with-${{ env.LAYOUT }}
- name: Test package - name: Package
run: python3 ./mach package --release run: python3 ./mach package --release
- name: Package smoketest - name: Package smoketest
run: ./etc/ci/macos_package_smoketest.sh target/release/servo-tech-demo.dmg run: ./etc/ci/macos_package_smoketest.sh target/release/servo-tech-demo.dmg
- 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 mac --secret-from-environment
env:
S3_UPLOAD_CREDENTIALS: ${{ secrets.S3_UPLOAD_CREDENTIALS }}
GITHUB_HOMEBREW_TOKEN: ${{ secrets.HOMEBREW_TOKEN }}
- name: Package binary - name: Package binary
run: gtar -czf target.tar.gz target/release/servo target/release/*.dylib resources run: gtar -czf target.tar.gz target/release/servo target/release/*.dylib resources
- name: Archive binary - name: Archive binary

View file

@ -35,6 +35,7 @@ jobs:
uses: ./.github/workflows/windows.yml uses: ./.github/workflows/windows.yml
with: with:
layout: '2013' layout: '2013'
unit-tests: true
build-mac: build-mac:
name: Mac name: Mac
@ -42,6 +43,7 @@ jobs:
uses: ./.github/workflows/mac.yml uses: ./.github/workflows/mac.yml
with: with:
layout: '2013' layout: '2013'
unit-tests: true
build-linux: build-linux:
name: Linux name: Linux

View file

@ -11,122 +11,38 @@ env:
SHELL: /bin/bash SHELL: /bin/bash
jobs: jobs:
upload-linux: upload-win:
# This job is only useful when run on upstream servo. # This job is only useful when run on upstream servo.
if: github.repository == 'servo/servo' || github.event_name == 'workflow_dispatch' if: github.repository == 'servo/servo' || github.event_name == 'workflow_dispatch'
name: Upload nightly (Linux) name: Upload nightly (Windows)
runs-on: ubuntu-20.04 uses: ./.github/workflows/windows.yml
strategy: with:
matrix: layout: '2013'
layout-engine: ['2013', '2020'] upload: true
include:
- layout-engine: '2013'
build-flag: '--with-layout-2013'
package: 'linux'
continue-on-error: false
- layout-engine: '2020'
build-flag: '--with-layout-2020'
package: 'linux-layout2020'
continue-on-error: true
continue-on-error: ${{ matrix.continue-on-error }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Bootstrap
run: |
python3 -m pip install --upgrade pip virtualenv
sudo apt update
python3 ./mach bootstrap
- name: Release build
run: python3 ./mach build --release ${{ matrix.build-flag }}
- name: Package
run: python3 ./mach package --release
- name: Upload
run: python3 ./mach upload-nightly ${{ matrix.package }} --secret-from-environment
env:
S3_UPLOAD_CREDENTIALS: ${{ secrets.S3_UPLOAD_CREDENTIALS }}
upload-mac: upload-mac:
# This job is only useful when run on upstream servo. # This job is only useful when run on upstream servo.
if: github.repository == 'servo/servo' || github.event_name == 'workflow_dispatch' if: github.repository == 'servo/servo' || github.event_name == 'workflow_dispatch'
name: Upload nightly (macOS) name: Upload nightly (macOS)
runs-on: macos-12 uses: ./.github/workflows/mac.yml
steps: with:
- uses: actions/checkout@v3 layout: '2013'
with: upload: true
fetch-depth: 2
# 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: Bootstrap
run: |
python3 -m pip install --upgrade pip virtualenv
brew bundle install --verbose --no-upgrade --file=etc/taskcluster/macos/Brewfile
brew bundle install --verbose --no-upgrade --file=etc/taskcluster/macos/Brewfile-build
rm -rf /usr/local/etc/openssl
rm -rf /usr/local/etc/openssl@1.1
brew install openssl@1.1 gnu-tar
- name: Release build
run: |
export OPENSSL_INCLUDE_DIR="$(brew --prefix openssl)/include"
export OPENSSL_LIB_DIR="$(brew --prefix openssl)/lib"
export PKG_CONFIG_PATH="$(brew --prefix libffi)/lib/pkgconfig/"
export PKG_CONFIG_PATH="$(brew --prefix zlib)/lib/pkgconfig/:$PKG_CONFIG_PATH"
python3 ./mach build --release
- name: Package
run: python3 ./mach package --release
- name: Smoketest
run: ./etc/ci/macos_package_smoketest.sh target/release/servo-tech-demo.dmg
- name: Upload
run: python3 ./mach upload-nightly mac --secret-from-environment
env:
S3_UPLOAD_CREDENTIALS: ${{ secrets.S3_UPLOAD_CREDENTIALS }}
GITHUB_HOMEBREW_TOKEN: ${{ secrets.HOMEBREW_TOKEN }}
upload-win: upload-linux:
# This job is only useful when run on upstream servo. # This job is only useful when run on upstream servo.
if: github.repository == 'servo/servo' || github.event_name == 'workflow_dispatch' if: github.repository == 'servo/servo' || github.event_name == 'workflow_dispatch'
name: Upload nightly (Windows) name: Upload nightly (Linux)
runs-on: windows-2019 uses: ./.github/workflows/linux.yml
steps: with:
- uses: actions/checkout@v3 layout: '2013'
with: upload: true
fetch-depth: 2
- name: Copy to C drive upload-linux-2020:
run: cp D:\a C:\ -Recurse # This job is only useful when run on upstream servo.
- uses: suisei-cn/actions-download-file@v1 if: github.repository == 'servo/servo' || github.event_name == 'workflow_dispatch'
id: wix311-binaries name: Upload nightly (Linux layout2020)
name: Download wix binaries uses: ./.github/workflows/linux.yml
with: with:
url: "https://github.com/wixtoolset/wix3/releases/download/wix3111rtm/wix311-binaries.zip" layout: '2020'
target: "C:\\wix311-binaries.zip" upload: true
- uses: DuckSoft/extract-7z-action@v1.0
name: Extract wix binaries
with:
pathSource: "C:\\wix311-binaries.zip"
pathTarget: "C:\\wix"
- name: Add binaries to path
run: echo "C:\\wix" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Bootstrap
working-directory: "C:\\a\\servo\\servo"
run: |
python -m pip install --upgrade pip virtualenv
python mach fetch
- name: Release build
working-directory: "C:\\a\\servo\\servo"
run: python mach build --release --media-stack=dummy
- name: Package
working-directory: "C:\\a\\servo\\servo"
run: python mach package --release
- name: Upload
working-directory: "C:\\a\\servo\\servo"
run: python mach upload-nightly windows-msvc --secret-from-environment
env:
S3_UPLOAD_CREDENTIALS: ${{ secrets.S3_UPLOAD_CREDENTIALS }}

View file

@ -6,12 +6,28 @@ on:
layout: layout:
required: true required: true
type: string type: string
unit-tests:
required: false
default: false
type: boolean
upload:
required: false
default: false
type: boolean
workflow_dispatch: workflow_dispatch:
inputs: inputs:
layout: layout:
required: true required: true
type: choice type: choice
options: ["2013", "2020"] options: ["2013", "2020"]
unit-tests:
required: false
default: false
type: boolean
upload:
required: false
default: false
type: boolean
push: push:
branches: ["try-windows"] branches: ["try-windows"]
@ -19,6 +35,7 @@ env:
RUST_BACKTRACE: 1 RUST_BACKTRACE: 1
SHELL: /bin/bash SHELL: /bin/bash
LAYOUT: "${{ contains(inputs.layout, '2020') && 'layout-2020' || 'layout-2013' }}" LAYOUT: "${{ contains(inputs.layout, '2020') && 'layout-2020' || 'layout-2013' }}"
PACKAGE: "${{ contains(inputs.layout, '2020') && 'windows-msvc-layout2020' || 'windows-msvc' }}"
jobs: jobs:
build-win: build-win:
@ -30,6 +47,12 @@ jobs:
fetch-depth: 2 fetch-depth: 2
- name: Copy to C drive - name: Copy to C drive
run: cp D:\a C:\ -Recurse run: cp D:\a C:\ -Recurse
- 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: Bootstrap - name: Bootstrap
working-directory: "C:\\a\\${{ github.event.repository.name }}\\${{ github.event.repository.name }}" working-directory: "C:\\a\\${{ github.event.repository.name }}\\${{ github.event.repository.name }}"
run: | run: |
@ -38,12 +61,30 @@ jobs:
- name: Release build - name: Release build
working-directory: "C:\\a\\${{ github.event.repository.name }}\\${{ github.event.repository.name }}" working-directory: "C:\\a\\${{ github.event.repository.name }}\\${{ github.event.repository.name }}"
run: python mach build --release --media-stack=dummy --with-${{ env.LAYOUT }} run: python mach build --release --media-stack=dummy --with-${{ env.LAYOUT }}
- name: Unit tests
working-directory: "C:\\a\\${{ github.event.repository.name }}\\${{ github.event.repository.name }}"
run: python mach test-unit --release --with-${{ env.LAYOUT }}
- name: Smoketest - name: Smoketest
working-directory: "C:\\a\\${{ github.event.repository.name }}\\${{ github.event.repository.name }}" working-directory: "C:\\a\\${{ github.event.repository.name }}\\${{ github.event.repository.name }}"
run: python mach smoketest --angle run: python mach smoketest --angle
- name: Unit tests
working-directory: "C:\\a\\${{ github.event.repository.name }}\\${{ github.event.repository.name }}"
if: ${{ inputs.unit-tests }}
run: python mach test-unit --release --with-${{ env.LAYOUT }}
- name: Package
working-directory: "C:\\a\\servo\\servo"
run: python mach package --release
- name: Upload Package
uses: actions/upload-artifact@v3
with:
name: ${{ env.PACKAGE }}
# 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
if: ${{ inputs.upload }}
run: python mach upload-nightly windows-msvc --secret-from-environment
env:
S3_UPLOAD_CREDENTIALS: ${{ secrets.S3_UPLOAD_CREDENTIALS }}
build_result: build_result:
name: homu build finished name: homu build finished