From cf4160b6ed73bbba5c891b1fd4dcceaf94ff9807 Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Tue, 11 Apr 2023 19:17:23 +0200 Subject: [PATCH] Reorganize the workflow files for pull requests a little. Split out the quick check GitHub action (which is really only meant for forks). This prevents the quick check from running twice for PRs from branches on the upstream repository. Also rename the WPT export action file to make it clearer that it runs for pull requests. --- ...hanges.yml => pull-request-wpt-export.yml} | 4 ++-- .github/workflows/pull-request.yml | 23 +++++++++++++++++++ .github/workflows/quick-check.yml | 6 ++++- 3 files changed, 30 insertions(+), 3 deletions(-) rename .github/workflows/{upstream-wpt-changes.yml => pull-request-wpt-export.yml} (94%) create mode 100644 .github/workflows/pull-request.yml diff --git a/.github/workflows/upstream-wpt-changes.yml b/.github/workflows/pull-request-wpt-export.yml similarity index 94% rename from .github/workflows/upstream-wpt-changes.yml rename to .github/workflows/pull-request-wpt-export.yml index 02afe64c750..092a5d043b9 100644 --- a/.github/workflows/upstream-wpt-changes.yml +++ b/.github/workflows/pull-request-wpt-export.yml @@ -1,4 +1,4 @@ -name: WPT export +name: Pull request (WPT export) on: pull_request_target: types: ['opened', 'synchronize', 'reopened', 'edited', 'closed'] @@ -37,4 +37,4 @@ jobs: run: servo/etc/ci/upstream-wpt-changes/upstream-wpt-changes.py env: GITHUB_CONTEXT: ${{ toJson(github) }} - WPT_SYNC_TOKEN: ${{ secrets.WPT_SYNC_TOKEN }} + WPT_SYNC_TOKEN: ${{ secrets.WPT_SYNC_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 00000000000..ab8f64ed687 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,23 @@ +name: Pull request +on: + pull_request: + types: ['opened', 'synchronize'] + branches: ["**"] + + +jobs: + build-linux: + name: Linux + if: github.repository == 'servo/servo' + uses: ./.github/workflows/linux.yml + with: + layout: '2013' + unit-tests: true + + build-linux-layout-2020: + name: Linux (layout-2020) + if: github.repository == 'servo/servo' + uses: ./.github/workflows/linux.yml + with: + layout: '2020' + unit-tests: false \ No newline at end of file diff --git a/.github/workflows/quick-check.yml b/.github/workflows/quick-check.yml index 8de237f6aaf..a1244b6b9ce 100644 --- a/.github/workflows/quick-check.yml +++ b/.github/workflows/quick-check.yml @@ -1,6 +1,8 @@ +# This action is meant as a quick check to be run when pushing to +# branches on forks. This allows forks to test the build and unit +# tests automatically without opening a pull request. name: Quick check on: - pull_request: push: branches: ["**", "!master", "!auto", "!try", "!try-linux", "!try-mac", "!try-windows", "!try-wpt", "!dependabot/**"] @@ -8,6 +10,7 @@ on: jobs: build-linux: name: Linux + if: github.repository != 'servo/servo' || github.event_name == 'workflow_dispatch' uses: ./.github/workflows/linux.yml with: layout: '2013' @@ -15,6 +18,7 @@ jobs: build-linux-layout-2020: name: Linux (layout-2020) + if: github.repository != 'servo/servo' || github.event_name == 'workflow_dispatch' uses: ./.github/workflows/linux.yml with: layout: '2020'