mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Add --production
option to mach (#30707)
* --prod(uction) mach argument * Use profile in workflows instead of production * Use profiles in unit tests * ups * Build (${{ inputs.profile }})
This commit is contained in:
parent
c78b98252a
commit
96d37d3785
9 changed files with 90 additions and 71 deletions
11
.github/workflows/linux-wpt.yml
vendored
11
.github/workflows/linux-wpt.yml
vendored
|
@ -2,9 +2,9 @@ name: Linux WPT Tests
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
production:
|
profile:
|
||||||
required: false
|
required: true
|
||||||
type: boolean
|
type: string
|
||||||
wpt:
|
wpt:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
|
@ -13,7 +13,6 @@ on:
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
env:
|
env:
|
||||||
cargo_profile_option: ${{ inputs.production && '--profile production' || '--release' }}
|
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
SHELL: /bin/bash
|
SHELL: /bin/bash
|
||||||
WPT_COMMAND_LINE_ARG: "${{ inputs.layout == 'layout-2013' && '--legacy-layout' || '' }}"
|
WPT_COMMAND_LINE_ARG: "${{ inputs.layout == 'layout-2013' && '--legacy-layout' || '' }}"
|
||||||
|
@ -71,7 +70,7 @@ jobs:
|
||||||
if: ${{ inputs.wpt != 'sync' }}
|
if: ${{ inputs.wpt != 'sync' }}
|
||||||
run: |
|
run: |
|
||||||
python3 ./mach test-wpt $WPT_COMMAND_LINE_ARG \
|
python3 ./mach test-wpt $WPT_COMMAND_LINE_ARG \
|
||||||
${{ env.cargo_profile_option }} --processes $(nproc) --timeout-multiplier 2 \
|
--${{ inputs.profile }} --processes $(nproc) --timeout-multiplier 2 \
|
||||||
--total-chunks ${{ env.max_chunk_id }} --this-chunk ${{ matrix.chunk_id }} \
|
--total-chunks ${{ env.max_chunk_id }} --this-chunk ${{ matrix.chunk_id }} \
|
||||||
--log-raw test-wpt.${{ matrix.chunk_id }}.log \
|
--log-raw test-wpt.${{ matrix.chunk_id }}.log \
|
||||||
--log-raw-unexpected unexpected-test-wpt.${{ matrix.chunk_id }}.log \
|
--log-raw-unexpected unexpected-test-wpt.${{ matrix.chunk_id }}.log \
|
||||||
|
@ -83,7 +82,7 @@ jobs:
|
||||||
if: ${{ inputs.wpt == 'sync' }}
|
if: ${{ inputs.wpt == 'sync' }}
|
||||||
run: |
|
run: |
|
||||||
python3 ./mach test-wpt $WPT_COMMAND_LINE_ARG \
|
python3 ./mach test-wpt $WPT_COMMAND_LINE_ARG \
|
||||||
${{ env.cargo_profile_option }} --processes $(nproc) --timeout-multiplier 2 \
|
--${{ inputs.profile }} --processes $(nproc) --timeout-multiplier 2 \
|
||||||
--total-chunks ${{ env.max_chunk_id }} --this-chunk ${{ matrix.chunk_id }} \
|
--total-chunks ${{ env.max_chunk_id }} --this-chunk ${{ matrix.chunk_id }} \
|
||||||
--log-raw test-wpt.${{ matrix.chunk_id }}.log \
|
--log-raw test-wpt.${{ matrix.chunk_id }}.log \
|
||||||
--always-succeed
|
--always-succeed
|
||||||
|
|
33
.github/workflows/linux.yml
vendored
33
.github/workflows/linux.yml
vendored
|
@ -2,10 +2,10 @@ name: Linux
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
production:
|
profile:
|
||||||
required: false
|
required: false
|
||||||
default: false
|
default: "release"
|
||||||
type: boolean
|
type: string
|
||||||
wpt:
|
wpt:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
|
@ -25,10 +25,11 @@ on:
|
||||||
type: string
|
type: string
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
production:
|
profile:
|
||||||
required: false
|
required: false
|
||||||
default: false
|
default: "release"
|
||||||
type: boolean
|
type: choice
|
||||||
|
options: ["release", "debug", "production"]
|
||||||
wpt:
|
wpt:
|
||||||
default: "test"
|
default: "test"
|
||||||
required: false
|
required: false
|
||||||
|
@ -50,8 +51,6 @@ on:
|
||||||
branches: ["try-linux", "try-wpt", "try-wpt-2020"]
|
branches: ["try-linux", "try-wpt", "try-wpt-2020"]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
cargo_profile_option: ${{ inputs.production && '--profile production' || '--release' }}
|
|
||||||
cargo_profile_name: ${{ inputs.production && 'production' || 'release' }}
|
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
SHELL: /bin/bash
|
SHELL: /bin/bash
|
||||||
SCCACHE_GHA_ENABLED: "true"
|
SCCACHE_GHA_ENABLED: "true"
|
||||||
|
@ -90,10 +89,10 @@ jobs:
|
||||||
run: sudo apt update && python3 ./mach bootstrap
|
run: sudo apt update && python3 ./mach bootstrap
|
||||||
- name: Tidy
|
- name: Tidy
|
||||||
run: python3 ./mach test-tidy --no-progress --all
|
run: python3 ./mach test-tidy --no-progress --all
|
||||||
- name: Release build (${{ inputs.production && 'without' || 'with' }} debug assertions)
|
- name: Build (${{ inputs.profile }})
|
||||||
run: python3 ./mach build ${{ env.cargo_profile_option }}
|
run: python3 ./mach build --${{ inputs.profile }}
|
||||||
- name: Smoketest
|
- name: Smoketest
|
||||||
run: xvfb-run python3 ./mach smoketest ${{ env.cargo_profile_option }}
|
run: xvfb-run python3 ./mach smoketest --${{ inputs.profile }}
|
||||||
- name: Script tests
|
- name: Script tests
|
||||||
run: ./mach test-scripts
|
run: ./mach test-scripts
|
||||||
- name: Unit tests
|
- name: Unit tests
|
||||||
|
@ -102,7 +101,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
timeout_minutes: 20
|
timeout_minutes: 20
|
||||||
max_attempts: 2 # https://github.com/servo/servo/issues/30683
|
max_attempts: 2 # https://github.com/servo/servo/issues/30683
|
||||||
command: python ./mach test-unit ${{ env.cargo_profile_option }}
|
command: python ./mach test-unit --${{ inputs.profile }}
|
||||||
- name: Rename build timing
|
- name: Rename build timing
|
||||||
run: cp -r target/cargo-timings target/cargo-timings-linux
|
run: cp -r target/cargo-timings target/cargo-timings-linux
|
||||||
- name: Archive build timing
|
- name: Archive build timing
|
||||||
|
@ -114,12 +113,12 @@ jobs:
|
||||||
- name: Lockfile check
|
- name: Lockfile check
|
||||||
run: ./etc/ci/lockfile_changed.sh
|
run: ./etc/ci/lockfile_changed.sh
|
||||||
- name: Build mach package
|
- name: Build mach package
|
||||||
run: python3 ./mach package ${{ env.cargo_profile_option }}
|
run: python3 ./mach package --${{ inputs.profile }}
|
||||||
- name: Upload artifact for mach package
|
- name: Upload artifact for mach package
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: linux
|
name: linux
|
||||||
path: target/${{ env.cargo_profile_name }}/servo-tech-demo.tar.gz
|
path: target/${{ inputs.profile }}/servo-tech-demo.tar.gz
|
||||||
- name: Upload nightly
|
- name: Upload nightly
|
||||||
if: ${{ inputs.upload }}
|
if: ${{ inputs.upload }}
|
||||||
run: |
|
run: |
|
||||||
|
@ -131,7 +130,7 @@ jobs:
|
||||||
NIGHTLY_REPO_TOKEN: ${{ secrets.NIGHTLY_REPO_TOKEN }}
|
NIGHTLY_REPO_TOKEN: ${{ secrets.NIGHTLY_REPO_TOKEN }}
|
||||||
NIGHTLY_REPO: ${{ github.repository_owner }}/servo-nightly-builds
|
NIGHTLY_REPO: ${{ github.repository_owner }}/servo-nightly-builds
|
||||||
- name: Build package for target
|
- name: Build package for target
|
||||||
run: tar -czf target.tar.gz target/${{ env.cargo_profile_name }}/servo resources
|
run: tar -czf target.tar.gz target/${{ inputs.profile }}/servo resources
|
||||||
- name: Upload artifact for target
|
- name: Upload artifact for target
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
@ -144,7 +143,7 @@ jobs:
|
||||||
needs: ["build"]
|
needs: ["build"]
|
||||||
uses: ./.github/workflows/linux-wpt.yml
|
uses: ./.github/workflows/linux-wpt.yml
|
||||||
with:
|
with:
|
||||||
production: ${{ inputs.production == 'true' }}
|
profile: ${{ inputs.profile }}
|
||||||
wpt: ${{ inputs.wpt }}
|
wpt: ${{ inputs.wpt }}
|
||||||
layout: "layout-2020"
|
layout: "layout-2020"
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
@ -155,7 +154,7 @@ jobs:
|
||||||
needs: ["build"]
|
needs: ["build"]
|
||||||
uses: ./.github/workflows/linux-wpt.yml
|
uses: ./.github/workflows/linux-wpt.yml
|
||||||
with:
|
with:
|
||||||
production: ${{ inputs.production == 'true' }}
|
profile: ${{ inputs.profile }}
|
||||||
wpt: ${{ inputs.wpt }}
|
wpt: ${{ inputs.wpt }}
|
||||||
layout: "layout-2013"
|
layout: "layout-2013"
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
11
.github/workflows/mac-wpt.yml
vendored
11
.github/workflows/mac-wpt.yml
vendored
|
@ -3,15 +3,14 @@ name: Mac WPT Tests
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
production:
|
profile:
|
||||||
required: false
|
required: true
|
||||||
type: boolean
|
type: string
|
||||||
layout:
|
layout:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
env:
|
env:
|
||||||
cargo_profile_option: ${{ inputs.production && '--profile production' || '--release' }}
|
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
SHELL: /bin/bash
|
SHELL: /bin/bash
|
||||||
WPT_COMMAND_LINE_ARG: "${{ inputs.layout == 'layout-2013' && '--legacy-layout' || '' }}"
|
WPT_COMMAND_LINE_ARG: "${{ inputs.layout == 'layout-2013' && '--legacy-layout' || '' }}"
|
||||||
|
@ -47,11 +46,11 @@ jobs:
|
||||||
python3 -m pip install --upgrade pip virtualenv
|
python3 -m pip install --upgrade pip virtualenv
|
||||||
python3 ./mach bootstrap
|
python3 ./mach bootstrap
|
||||||
- name: Smoketest
|
- name: Smoketest
|
||||||
run: python3 ./mach smoketest ${{ env.cargo_profile_option }}
|
run: python3 ./mach smoketest --${{ inputs.profile }}
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
python3 ./mach test-wpt $WPT_COMMAND_LINE_ARG \
|
python3 ./mach test-wpt $WPT_COMMAND_LINE_ARG \
|
||||||
${{ env.cargo_profile_option }} --processes $(sysctl -n hw.logicalcpu) --timeout-multiplier 8 \
|
--${{ inputs.profile }} --processes $(sysctl -n hw.logicalcpu) --timeout-multiplier 8 \
|
||||||
--total-chunks ${{ env.max_chunk_id }} --this-chunk ${{ matrix.chunk_id }} \
|
--total-chunks ${{ env.max_chunk_id }} --this-chunk ${{ matrix.chunk_id }} \
|
||||||
--log-raw test-wpt.${{ matrix.chunk_id }}.log \
|
--log-raw test-wpt.${{ matrix.chunk_id }}.log \
|
||||||
--log-raw-unexpected unexpected-test-wpt.${{ matrix.chunk_id }}.log \
|
--log-raw-unexpected unexpected-test-wpt.${{ matrix.chunk_id }}.log \
|
||||||
|
|
35
.github/workflows/mac.yml
vendored
35
.github/workflows/mac.yml
vendored
|
@ -3,10 +3,10 @@ name: Mac
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
production:
|
profile:
|
||||||
required: false
|
required: false
|
||||||
default: false
|
default: "release"
|
||||||
type: boolean
|
type: string
|
||||||
wpt-layout:
|
wpt-layout:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
|
@ -23,10 +23,11 @@ on:
|
||||||
type: string
|
type: string
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
production:
|
profile:
|
||||||
required: false
|
required: false
|
||||||
default: false
|
default: "release"
|
||||||
type: boolean
|
type: choice
|
||||||
|
options: ["release", "debug", "production"]
|
||||||
wpt-layout:
|
wpt-layout:
|
||||||
required: false
|
required: false
|
||||||
type: choice
|
type: choice
|
||||||
|
@ -43,8 +44,6 @@ on:
|
||||||
branches: ["try-mac", "try-wpt-mac", "try-wpt-mac-2020"]
|
branches: ["try-mac", "try-wpt-mac", "try-wpt-mac-2020"]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
cargo_profile_option: ${{ inputs.production && '--profile production' || '--release' }}
|
|
||||||
cargo_profile_name: ${{ inputs.production && 'production' || 'release' }}
|
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
SHELL: /bin/bash
|
SHELL: /bin/bash
|
||||||
SCCACHE_GHA_ENABLED: "true"
|
SCCACHE_GHA_ENABLED: "true"
|
||||||
|
@ -80,11 +79,11 @@ jobs:
|
||||||
python3 -m pip install --upgrade pip virtualenv
|
python3 -m pip install --upgrade pip virtualenv
|
||||||
python3 ./mach bootstrap
|
python3 ./mach bootstrap
|
||||||
brew install gnu-tar
|
brew install gnu-tar
|
||||||
- name: Release build (${{ inputs.production && 'without' || 'with' }} debug assertions)
|
- name: Build (${{ inputs.profile }})
|
||||||
run: |
|
run: |
|
||||||
python3 ./mach build ${{ env.cargo_profile_option }}
|
python3 ./mach build --${{ inputs.profile }}
|
||||||
- name: Smoketest
|
- name: Smoketest
|
||||||
run: python3 ./mach smoketest ${{ env.cargo_profile_option }}
|
run: python3 ./mach smoketest --${{ inputs.profile }}
|
||||||
- name: Script tests
|
- name: Script tests
|
||||||
run: ./mach test-scripts
|
run: ./mach test-scripts
|
||||||
- name: Unit tests
|
- name: Unit tests
|
||||||
|
@ -93,11 +92,11 @@ jobs:
|
||||||
with:
|
with:
|
||||||
timeout_minutes: 20 # https://github.com/servo/servo/issues/30275
|
timeout_minutes: 20 # https://github.com/servo/servo/issues/30275
|
||||||
max_attempts: 3 # https://github.com/servo/servo/issues/30683
|
max_attempts: 3 # https://github.com/servo/servo/issues/30683
|
||||||
command: python3 ./mach test-unit ${{ env.cargo_profile_option }}
|
command: python3 ./mach test-unit --${{ inputs.profile }}
|
||||||
- name: Build mach package
|
- name: Build mach package
|
||||||
run: python3 ./mach package ${{ env.cargo_profile_option }}
|
run: python3 ./mach package --${{ inputs.profile }}
|
||||||
- name: Run smoketest for mach package
|
- name: Run smoketest for mach package
|
||||||
run: ./etc/ci/macos_package_smoketest.sh target/${{ env.cargo_profile_name }}/servo-tech-demo.dmg
|
run: ./etc/ci/macos_package_smoketest.sh target/${{ inputs.profile }}/servo-tech-demo.dmg
|
||||||
- name: Rename build timing
|
- name: Rename build timing
|
||||||
run: cp -r target/cargo-timings target/cargo-timings-macos
|
run: cp -r target/cargo-timings target/cargo-timings-macos
|
||||||
- name: Archive build timing
|
- name: Archive build timing
|
||||||
|
@ -110,7 +109,7 @@ jobs:
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: mac
|
name: mac
|
||||||
path: target/${{ env.cargo_profile_name }}/servo-tech-demo.dmg
|
path: target/${{ inputs.profile }}/servo-tech-demo.dmg
|
||||||
- name: Upload nightly
|
- name: Upload nightly
|
||||||
if: ${{ inputs.upload }}
|
if: ${{ inputs.upload }}
|
||||||
run: |
|
run: |
|
||||||
|
@ -122,7 +121,7 @@ jobs:
|
||||||
NIGHTLY_REPO_TOKEN: ${{ secrets.NIGHTLY_REPO_TOKEN }}
|
NIGHTLY_REPO_TOKEN: ${{ secrets.NIGHTLY_REPO_TOKEN }}
|
||||||
NIGHTLY_REPO: ${{ github.repository_owner }}/servo-nightly-builds
|
NIGHTLY_REPO: ${{ github.repository_owner }}/servo-nightly-builds
|
||||||
- name: Build package for target
|
- name: Build package for target
|
||||||
run: gtar -czf target.tar.gz target/${{ env.cargo_profile_name }}/servo target/${{ env.cargo_profile_name }}/*.dylib target/${{ env.cargo_profile_name }}/lib/*.dylib resources
|
run: gtar -czf target.tar.gz target/${{ inputs.profile }}/servo target/${{ inputs.profile }}/*.dylib target/${{ inputs.profile }}/lib/*.dylib resources
|
||||||
- name: Upload package for target
|
- name: Upload package for target
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
@ -135,7 +134,7 @@ jobs:
|
||||||
needs: ["build"]
|
needs: ["build"]
|
||||||
uses: ./.github/workflows/mac-wpt.yml
|
uses: ./.github/workflows/mac-wpt.yml
|
||||||
with:
|
with:
|
||||||
production: ${{ inputs.production == 'true' }}
|
profile: ${{ inputs.profile }}
|
||||||
layout: "layout-2020"
|
layout: "layout-2020"
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
|
@ -145,7 +144,7 @@ jobs:
|
||||||
needs: ["build"]
|
needs: ["build"]
|
||||||
uses: ./.github/workflows/mac-wpt.yml
|
uses: ./.github/workflows/mac-wpt.yml
|
||||||
with:
|
with:
|
||||||
production: ${{ inputs.production == 'true' }}
|
profile: ${{ inputs.profile }}
|
||||||
layout: "layout-2013"
|
layout: "layout-2013"
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
|
|
3
.github/workflows/main.yml
vendored
3
.github/workflows/main.yml
vendored
|
@ -85,6 +85,7 @@ jobs:
|
||||||
if: ${{ contains(fromJson(needs.decision.outputs.configuration).platforms, 'windows') }}
|
if: ${{ contains(fromJson(needs.decision.outputs.configuration).platforms, 'windows') }}
|
||||||
uses: ./.github/workflows/windows.yml
|
uses: ./.github/workflows/windows.yml
|
||||||
with:
|
with:
|
||||||
|
profile: "release"
|
||||||
unit-tests: ${{ fromJson(needs.decision.outputs.configuration).unit_tests }}
|
unit-tests: ${{ fromJson(needs.decision.outputs.configuration).unit_tests }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
|
@ -94,6 +95,7 @@ jobs:
|
||||||
if: ${{ contains(fromJson(needs.decision.outputs.configuration).platforms, 'macos') }}
|
if: ${{ contains(fromJson(needs.decision.outputs.configuration).platforms, 'macos') }}
|
||||||
uses: ./.github/workflows/mac.yml
|
uses: ./.github/workflows/mac.yml
|
||||||
with:
|
with:
|
||||||
|
profile: "release"
|
||||||
unit-tests: ${{ fromJson(needs.decision.outputs.configuration).unit_tests }}
|
unit-tests: ${{ fromJson(needs.decision.outputs.configuration).unit_tests }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
|
@ -103,6 +105,7 @@ jobs:
|
||||||
if: ${{ contains(fromJson(needs.decision.outputs.configuration).platforms, 'linux') }}
|
if: ${{ contains(fromJson(needs.decision.outputs.configuration).platforms, 'linux') }}
|
||||||
uses: ./.github/workflows/linux.yml
|
uses: ./.github/workflows/linux.yml
|
||||||
with:
|
with:
|
||||||
|
profile: "release"
|
||||||
wpt: 'test'
|
wpt: 'test'
|
||||||
layout: ${{ fromJson(needs.decision.outputs.configuration).layout }}
|
layout: ${{ fromJson(needs.decision.outputs.configuration).layout }}
|
||||||
unit-tests: ${{ fromJson(needs.decision.outputs.configuration).unit_tests }}
|
unit-tests: ${{ fromJson(needs.decision.outputs.configuration).unit_tests }}
|
||||||
|
|
6
.github/workflows/nightly.yml
vendored
6
.github/workflows/nightly.yml
vendored
|
@ -70,7 +70,7 @@ jobs:
|
||||||
- create-draft-release
|
- create-draft-release
|
||||||
uses: ./.github/workflows/windows.yml
|
uses: ./.github/workflows/windows.yml
|
||||||
with:
|
with:
|
||||||
production: true
|
profile: "production"
|
||||||
upload: true
|
upload: true
|
||||||
github-release-id: ${{ needs.create-draft-release.outputs.release-id }}
|
github-release-id: ${{ needs.create-draft-release.outputs.release-id }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
@ -83,7 +83,7 @@ jobs:
|
||||||
- create-draft-release
|
- create-draft-release
|
||||||
uses: ./.github/workflows/mac.yml
|
uses: ./.github/workflows/mac.yml
|
||||||
with:
|
with:
|
||||||
production: true
|
profile: "production"
|
||||||
upload: true
|
upload: true
|
||||||
github-release-id: ${{ needs.create-draft-release.outputs.release-id }}
|
github-release-id: ${{ needs.create-draft-release.outputs.release-id }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
@ -96,7 +96,7 @@ jobs:
|
||||||
- create-draft-release
|
- create-draft-release
|
||||||
uses: ./.github/workflows/linux.yml
|
uses: ./.github/workflows/linux.yml
|
||||||
with:
|
with:
|
||||||
production: true
|
profile: "production"
|
||||||
upload: true
|
upload: true
|
||||||
github-release-id: ${{ needs.create-draft-release.outputs.release-id }}
|
github-release-id: ${{ needs.create-draft-release.outputs.release-id }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
32
.github/workflows/windows.yml
vendored
32
.github/workflows/windows.yml
vendored
|
@ -3,9 +3,9 @@ name: Windows
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
production:
|
profile:
|
||||||
required: false
|
required: true
|
||||||
type: boolean
|
type: string
|
||||||
unit-tests:
|
unit-tests:
|
||||||
required: false
|
required: false
|
||||||
default: false
|
default: false
|
||||||
|
@ -19,9 +19,11 @@ on:
|
||||||
type: string
|
type: string
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
production:
|
profile:
|
||||||
required: false
|
required: false
|
||||||
type: boolean
|
default: "release"
|
||||||
|
options: ["release", "debug", "production"]
|
||||||
|
type: choice
|
||||||
unit-tests:
|
unit-tests:
|
||||||
required: false
|
required: false
|
||||||
default: false
|
default: false
|
||||||
|
@ -34,8 +36,6 @@ on:
|
||||||
branches: ["try-windows"]
|
branches: ["try-windows"]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
cargo_profile_option: ${{ inputs.production && '--profile production' || '--release' }}
|
|
||||||
cargo_profile_name: ${{ inputs.production && 'production' || 'release' }}
|
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
SHELL: /bin/bash
|
SHELL: /bin/bash
|
||||||
CCACHE: "ccache"
|
CCACHE: "ccache"
|
||||||
|
@ -77,19 +77,19 @@ jobs:
|
||||||
python -m pip install --upgrade pip virtualenv
|
python -m pip install --upgrade pip virtualenv
|
||||||
python mach fetch
|
python mach fetch
|
||||||
python mach bootstrap-gstreamer
|
python mach bootstrap-gstreamer
|
||||||
- name: Release build (${{ inputs.production && 'without' || 'with' }} debug assertions)
|
- name: Build (${{ inputs.profile }})
|
||||||
run: python mach build ${{ env.cargo_profile_option }}
|
run: python mach build --${{ inputs.profile }}
|
||||||
- name: Copy resources
|
- name: Copy resources
|
||||||
run: cp D:\a\servo\servo\resources C:\a\servo\servo -Recurse
|
run: cp D:\a\servo\servo\resources C:\a\servo\servo -Recurse
|
||||||
- name: Smoketest
|
- name: Smoketest
|
||||||
run: python mach smoketest --angle ${{ env.cargo_profile_option }}
|
run: python mach smoketest --angle --${{ inputs.profile }}
|
||||||
- name: Unit tests
|
- name: Unit tests
|
||||||
if: ${{ inputs.unit-tests || github.ref_name == 'try-windows' }}
|
if: ${{ inputs.unit-tests || github.ref_name == 'try-windows' }}
|
||||||
uses: nick-fields/retry@v2
|
uses: nick-fields/retry@v2
|
||||||
with:
|
with:
|
||||||
timeout_minutes: 30
|
timeout_minutes: 30
|
||||||
max_attempts: 3 # https://github.com/servo/servo/issues/30683
|
max_attempts: 3 # https://github.com/servo/servo/issues/30683
|
||||||
command: python mach test-unit ${{ env.cargo_profile_option }} -- -- --test-threads=1
|
command: python mach test-unit --${{ inputs.profile }} -- -- --test-threads=1
|
||||||
- name: Rename build timing
|
- name: Rename build timing
|
||||||
run: cp C:\a\servo\servo\target\cargo-timings C:\a\servo\servo\target\cargo-timings-windows -Recurse
|
run: cp C:\a\servo\servo\target\cargo-timings C:\a\servo\servo\target\cargo-timings-windows -Recurse
|
||||||
- name: Archive build timing
|
- name: Archive build timing
|
||||||
|
@ -99,16 +99,16 @@ jobs:
|
||||||
# Using a wildcard here ensures that the archive includes the path.
|
# Using a wildcard here ensures that the archive includes the path.
|
||||||
path: C:\\a\\servo\\servo\\target\\cargo-timings-*
|
path: C:\\a\\servo\\servo\\target\\cargo-timings-*
|
||||||
- name: Build mach package
|
- name: Build mach package
|
||||||
run: python mach package ${{ env.cargo_profile_option }}
|
run: python mach package --${{ inputs.profile }}
|
||||||
- name: Upload artifact for mach package
|
- name: Upload artifact for mach package
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: win
|
name: win
|
||||||
# These files are available
|
# These files are available
|
||||||
# MSI Installer: C:\a\servo\servo\target\${{ env.cargo_profile_name }}\msi\Installer.msi
|
# MSI Installer: C:\a\servo\servo\target\${{ inputs.profile }}\msi\Installer.msi
|
||||||
# Bundle: C:\a\servo\servo\target\${{ env.cargo_profile_name }}\msi\Servo.exe
|
# Bundle: C:\a\servo\servo\target\${{ inputs.profile }}\msi\Servo.exe
|
||||||
# Zip: C:\a\servo\servo\target\${{ env.cargo_profile_name }}\msi\Servo.zip
|
# Zip: C:\a\servo\servo\target\${{ inputs.profile }}\msi\Servo.zip
|
||||||
path: C:\\a\\servo\\servo\\target\\${{ env.cargo_profile_name }}\\msi\\Servo.exe
|
path: C:\\a\\servo\\servo\\target\\${{ inputs.profile }}\\msi\\Servo.exe
|
||||||
- name: Upload nightly
|
- name: Upload nightly
|
||||||
if: ${{ inputs.upload }}
|
if: ${{ inputs.upload }}
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -63,6 +63,9 @@ class BuildType:
|
||||||
def release() -> BuildType:
|
def release() -> BuildType:
|
||||||
return BuildType(BuildType.Kind.RELEASE, None)
|
return BuildType(BuildType.Kind.RELEASE, None)
|
||||||
|
|
||||||
|
def prod() -> BuildType:
|
||||||
|
return BuildType(BuildType.Kind.CUSTOM, "production")
|
||||||
|
|
||||||
def custom(profile: str) -> BuildType:
|
def custom(profile: str) -> BuildType:
|
||||||
return BuildType(BuildType.Kind.CUSTOM, profile)
|
return BuildType(BuildType.Kind.CUSTOM, profile)
|
||||||
|
|
||||||
|
@ -72,6 +75,9 @@ class BuildType:
|
||||||
def is_release(self) -> bool:
|
def is_release(self) -> bool:
|
||||||
return self.kind == BuildType.Kind.RELEASE
|
return self.kind == BuildType.Kind.RELEASE
|
||||||
|
|
||||||
|
def is_prod(self) -> bool:
|
||||||
|
return self.kind == BuildType.Kind.CUSTOM and self.profile == "production"
|
||||||
|
|
||||||
def is_custom(self) -> bool:
|
def is_custom(self) -> bool:
|
||||||
return self.kind == BuildType.Kind.CUSTOM
|
return self.kind == BuildType.Kind.CUSTOM
|
||||||
|
|
||||||
|
@ -734,6 +740,9 @@ class CommandBase(object):
|
||||||
CommandArgument('--dev', '--debug', '-d', group="Build Type",
|
CommandArgument('--dev', '--debug', '-d', group="Build Type",
|
||||||
action='store_true',
|
action='store_true',
|
||||||
help='Build in development mode'),
|
help='Build in development mode'),
|
||||||
|
CommandArgument('--prod', '--production', group="Build Type",
|
||||||
|
action='store_true',
|
||||||
|
help='Build in release mode without debug assertions'),
|
||||||
CommandArgument('--profile', group="Build Type",
|
CommandArgument('--profile', group="Build Type",
|
||||||
help='Build with custom Cargo profile'),
|
help='Build with custom Cargo profile'),
|
||||||
]
|
]
|
||||||
|
@ -798,10 +807,11 @@ class CommandBase(object):
|
||||||
# If `build_type` already exists in kwargs we are doing a recursive dispatch.
|
# If `build_type` already exists in kwargs we are doing a recursive dispatch.
|
||||||
if 'build_type' not in kwargs:
|
if 'build_type' not in kwargs:
|
||||||
kwargs['build_type'] = self.configure_build_type(
|
kwargs['build_type'] = self.configure_build_type(
|
||||||
kwargs['release'], kwargs['dev'], kwargs['profile'],
|
kwargs['release'], kwargs['dev'], kwargs['prod'], kwargs['profile'],
|
||||||
)
|
)
|
||||||
kwargs.pop('release', None)
|
kwargs.pop('release', None)
|
||||||
kwargs.pop('dev', None)
|
kwargs.pop('dev', None)
|
||||||
|
kwargs.pop('prod', None)
|
||||||
kwargs.pop('profile', None)
|
kwargs.pop('profile', None)
|
||||||
|
|
||||||
if build_configuration:
|
if build_configuration:
|
||||||
|
@ -819,8 +829,8 @@ class CommandBase(object):
|
||||||
|
|
||||||
return decorator_function
|
return decorator_function
|
||||||
|
|
||||||
def configure_build_type(self, release: bool, dev: bool, profile: Optional[str]) -> BuildType:
|
def configure_build_type(self, release: bool, dev: bool, prod: bool, profile: Optional[str]) -> BuildType:
|
||||||
option_count = release + dev + (profile is not None)
|
option_count = release + dev + prod + (profile is not None)
|
||||||
|
|
||||||
if option_count > 1:
|
if option_count > 1:
|
||||||
print("Please specify either --dev (-d) for a development")
|
print("Please specify either --dev (-d) for a development")
|
||||||
|
@ -842,6 +852,8 @@ class CommandBase(object):
|
||||||
return BuildType.release()
|
return BuildType.release()
|
||||||
elif dev:
|
elif dev:
|
||||||
return BuildType.dev()
|
return BuildType.dev()
|
||||||
|
elif prod:
|
||||||
|
return BuildType.prod()
|
||||||
else:
|
else:
|
||||||
return BuildType.custom(profile)
|
return BuildType.custom(profile)
|
||||||
|
|
||||||
|
|
|
@ -174,8 +174,8 @@ class MachCommands(CommandBase):
|
||||||
help="Run in bench mode")
|
help="Run in bench mode")
|
||||||
@CommandArgument('--nocapture', default=False, action="store_true",
|
@CommandArgument('--nocapture', default=False, action="store_true",
|
||||||
help="Run tests with nocapture ( show test stdout )")
|
help="Run tests with nocapture ( show test stdout )")
|
||||||
@CommandBase.common_command_arguments(build_configuration=True, build_type=False)
|
@CommandBase.common_command_arguments(build_configuration=True, build_type=True)
|
||||||
def test_unit(self, test_name=None, package=None, bench=False, nocapture=False, **kwargs):
|
def test_unit(self, build_type: BuildType, test_name=None, package=None, bench=False, nocapture=False, **kwargs):
|
||||||
if test_name is None:
|
if test_name is None:
|
||||||
test_name = []
|
test_name = []
|
||||||
|
|
||||||
|
@ -239,6 +239,14 @@ class MachCommands(CommandBase):
|
||||||
|
|
||||||
# Gather Cargo build timings (https://doc.rust-lang.org/cargo/reference/timings.html).
|
# Gather Cargo build timings (https://doc.rust-lang.org/cargo/reference/timings.html).
|
||||||
args = ["--timings"]
|
args = ["--timings"]
|
||||||
|
|
||||||
|
if build_type.is_release():
|
||||||
|
args += ["--release"]
|
||||||
|
elif build_type.is_dev():
|
||||||
|
pass # there is no argument for debug
|
||||||
|
else:
|
||||||
|
args += ["--profile", build_type.profile]
|
||||||
|
|
||||||
for crate in packages:
|
for crate in packages:
|
||||||
args += ["-p", "%s_tests" % crate]
|
args += ["-p", "%s_tests" % crate]
|
||||||
for crate in in_crate_packages:
|
for crate in in_crate_packages:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue