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: 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 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 }} diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 00000000000..7ac0ce74aa9 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,32 @@ +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: 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}" ]]