From dcc35c4e9a506366373ccc9441e00f9e342f01b1 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 24 May 2021 19:39:41 -0400 Subject: [PATCH 1/5] Regenerate CI workflow. --- .github/workflows/main.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 80026118326..5038bded114 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,11 +1,9 @@ name: CI on: - # Triggers the workflow on push or pull request events but only for the master branch + # Triggers the workflow on push events but only for the master branch push: - branches: [ "master", "github-actions-dev", "auto", "try", "try-linux", "try-mac", "try-windows", "try-wpt", "linux-wpt-tests"] - pull_request: - branches: [ "master", "github-actions-dev" ] + branches: [ "auto", "try", "try-linux", "try-mac", "try-windows", "try-wpt"] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -63,6 +61,12 @@ jobs: python3 ./mach build --release - name: Smoketest run: python3 ./mach smoketest + - name: Unit tests + run: python3 ./mach test-unit --release + - name: Test package + run: python3 ./mach package --release + - name: Package smoketest + run: ./etc/ci/macos_package_smoketest.sh 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 From 7a593bcc38509615ae06fbebafadff61366d2ccf Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 24 May 2021 19:40:48 -0400 Subject: [PATCH 2/5] Set up virtualenv before compiling docs. --- .github/workflows/docs.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 4c92e6c2fa6..378b0b140c1 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -13,6 +13,11 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 2 + - name: Bootstrap + run: | + python3 -m pip install --upgrade pip virtualenv + sudo apt update + python3 ./mach bootstrap - name: Compile docs run: python3 ./mach doc env: From 0294838d73263948a1f44c574927c0f26bc00f4e Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 24 May 2021 20:09:00 -0400 Subject: [PATCH 3/5] Fix windows nightly working directory. --- .github/workflows/nightly.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 2748ce5534d..c7f3c974e7c 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -93,18 +93,18 @@ jobs: - name: Copy to C drive run: cp D:\a C:\ -Recurse - name: Bootstrap - working-directory: "C:\\a\\${ REPOSITORY_NAME }\\${ REPOSITORY_NAME }" + working-directory: "C:\\a\\${{ github.event.repository.name }}\\${{ github.event.repository.name }}" run: | python -m pip install --upgrade pip virtualenv python mach fetch - name: Release build - working-directory: "C:\\a\\${ REPOSITORY_NAME }\\${ REPOSITORY_NAME }" + working-directory: "C:\\a\\${{ github.event.repository.name }}\\${{ github.event.repository.name }}" run: python mach build --release --media-stack=dummy - name: Package - working-directory: "C:\\a\\${ REPOSITORY_NAME }\\${ REPOSITORY_NAME }" + working-directory: "C:\\a\\${{ github.event.repository.name }}\\${{ github.event.repository.name }}" run: python mach package --release - name: Upload - working-directory: "C:\\a\\${ REPOSITORY_NAME }\\${ REPOSITORY_NAME }" + working-directory: "C:\\a\\${{ github.event.repository.name }}\\${{ github.event.repository.name }}" run: python mach upload-nightly windows-msvc --secret-from-environment env: S3_UPLOAD_CREDENTIALS: ${{ secrets.S3_UPLOAD_CREDENTIALS }} From 3237f3852cb308b0b25dfc3956c2a05a5bcaae5b Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 24 May 2021 20:14:42 -0400 Subject: [PATCH 4/5] Add limited job that runs against pull requests. --- .github/workflows/pull-request.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/pull-request.yml diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 00000000000..44e386af935 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,30 @@ +name: Basic cross-platform builds and checks +on: + pull_request: + branches: ["**"] + +env: + RUST_BACKTRACE: 1 + SHELL: /bin/bash + +jobs: + build-linux: + name: Build (Linux) + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: Bootstrap + run: | + python3 -m pip install --upgrade pip virtualenv + sudo apt update + python3 ./mach bootstrap + - name: Tidy + run: python3 ./mach test-tidy --no-progress --all + - name: Release build + run: python3 ./mach build --release + - name: Unit tests + run: python3 ./mach test-unit --release + - name: Lockfile check + run: ./etc/ci/lockfile_changed.sh From 4138d04186677998a1cfc042347d3faff5e36eaa Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 24 May 2021 20:19:18 -0400 Subject: [PATCH 5/5] Fail CI if workflow needs regenerating. --- .github/workflows/pull-request.yml | 6 ++++-- etc/ci/workflow_changed.sh | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100755 etc/ci/workflow_changed.sh diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 44e386af935..7ac0ce74aa9 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -20,11 +20,13 @@ jobs: python3 -m pip install --upgrade pip virtualenv sudo apt update python3 ./mach bootstrap - - name: Tidy - run: python3 ./mach test-tidy --no-progress --all + - name: Workflow check + run: ./etc/ci/workflow_changed.sh - name: Release build run: python3 ./mach build --release - name: Unit tests run: python3 ./mach test-unit --release + - name: Tidy + run: python3 ./mach test-tidy --no-progress --all - name: Lockfile check run: ./etc/ci/lockfile_changed.sh diff --git a/etc/ci/workflow_changed.sh b/etc/ci/workflow_changed.sh new file mode 100755 index 00000000000..c87775a7057 --- /dev/null +++ b/etc/ci/workflow_changed.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + +set -o errexit +set -o nounset +set -o pipefail + +python3 etc/ci/generate_workflow.py + +diff="$(find . -name 'main.yml' -print0 | xargs -0 git diff)" +echo "${diff}" +[[ -z "${diff}" ]]