From ec5b646b50eb29b5dfb1e4efad6fdafedf361de6 Mon Sep 17 00:00:00 2001 From: sagudev <16504129+sagudev@users.noreply.github.com> Date: Thu, 6 Apr 2023 16:19:08 +0200 Subject: [PATCH] Package in platform workflows --- .github/workflows/linux.yml | 8 ++++++++ .github/workflows/mac.yml | 17 ++++++++++++++++- .github/workflows/main.yml | 2 ++ .github/workflows/windows.yml | 30 +++++++++++++++++++++++++++--- 4 files changed, 53 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 8b5cd8504b2..fb7f565eaa8 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -34,6 +34,7 @@ env: RUST_BACKTRACE: 1 SHELL: /bin/bash LAYOUT: "${{ contains(inputs.layout, '2020') && 'layout-2020' || 'layout-2013' }}" + PACKAGE: "${{ contains(inputs.layout, '2020') && 'linux-layout2020' || 'linux' }}" SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" CCACHE: "sccache" @@ -65,6 +66,13 @@ jobs: run: python3 ./mach test-unit --release --with-${{ env.LAYOUT }} - name: Lockfile check 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: Package binary run: tar -czf target.tar.gz target/release/servo resources - name: Archive binary diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 0609b35d2dc..7240e6dbfeb 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -6,12 +6,20 @@ on: layout: required: true type: string + unit-tests: + required: false + default: false + type: boolean workflow_dispatch: inputs: layout: required: true type: choice options: ["2013", "2020"] + unit-tests: + required: false + default: false + type: boolean push: branches: ["try-mac"] @@ -19,6 +27,7 @@ env: RUST_BACKTRACE: 1 SHELL: /bin/bash LAYOUT: "${{ contains(inputs.layout, '2020') && 'layout-2020' || 'layout-2013' }}" + PACKAGE: "${{ contains(inputs.layout, '2020') && 'mac-layout2020' || 'mac' }}" SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" CCACHE: "sccache" @@ -61,11 +70,17 @@ jobs: - name: Smoketest run: python3 ./mach smoketest - name: Unit tests + if: ${{ inputs.unit-tests }} run: python3 ./mach test-unit --release --with-${{ env.LAYOUT }} - - name: Test package + - name: Package run: python3 ./mach package --release - name: Package smoketest 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: Package binary run: gtar -czf target.tar.gz target/release/servo target/release/*.dylib resources - name: Archive binary diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 90ebb4a0352..786a9943cf6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,6 +35,7 @@ jobs: uses: ./.github/workflows/windows.yml with: layout: '2013' + unit-tests: true build-mac: name: Mac @@ -42,6 +43,7 @@ jobs: uses: ./.github/workflows/mac.yml with: layout: '2013' + unit-tests: true build-linux: name: Linux diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a7ef7a4ea86..3f0f3b554ef 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -6,12 +6,20 @@ on: layout: required: true type: string + unit-tests: + required: false + default: false + type: boolean workflow_dispatch: inputs: layout: required: true type: choice options: ["2013", "2020"] + unit-tests: + required: false + default: false + type: boolean push: branches: ["try-windows"] @@ -19,6 +27,7 @@ env: RUST_BACKTRACE: 1 SHELL: /bin/bash LAYOUT: "${{ contains(inputs.layout, '2020') && 'layout-2020' || 'layout-2013' }}" + PACKAGE: "${{ contains(inputs.layout, '2020') && 'windows-msvc-layout2020' || 'windows-msvc' }}" jobs: build-win: @@ -30,6 +39,12 @@ jobs: fetch-depth: 2 - name: Copy to C drive 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 working-directory: "C:\\a\\${{ github.event.repository.name }}\\${{ github.event.repository.name }}" run: | @@ -38,12 +53,21 @@ jobs: - name: Release build working-directory: "C:\\a\\${{ github.event.repository.name }}\\${{ github.event.repository.name }}" 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 working-directory: "C:\\a\\${{ github.event.repository.name }}\\${{ github.event.repository.name }}" 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 }} + path: target/release/msi/Servo.exe build_result: name: homu build finished