diff --git a/.github/workflows/tests-fallback.yaml b/.github/workflows/tests-fallback.yaml new file mode 100644 index 000000000000..377a854cce51 --- /dev/null +++ b/.github/workflows/tests-fallback.yaml @@ -0,0 +1,46 @@ +# Part of the Carbon Language project, under the Apache License v2.0 with LLVM +# Exceptions. See /LICENSE for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +# Note that this name must exactly match the name in `tests.yaml`. +# +# This is not a real "test" workflow, but a fallback used to work around a +# problem where ignored checks cannot be required: +# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onpushpull_requestpull_request_targetpathspaths-ignore +name: test + +# This mus exactly match the `on` clause in `tests.yaml` except for inverting +# `paths-ignore` to `paths`. The purpose is that exactly one of this workflow or +# the one in `tests.yaml` fires for a given case. +on: + push: + branches: [trunk] + paths: + - '**/*.md' + - 'LICENSE' + - 'CODEOWNERS' + - '.git*' + pull_request_target: + paths: + - '**/*.md' + - 'LICENSE' + - 'CODEOWNERS' + - '.git*' + merge_group: + paths: + - '**/*.md' + - 'LICENSE' + - 'CODEOWNERS' + - '.git*' + +# Cancel previous workflows on the PR when there are multiple fast commits. +# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + steps: + - run: 'echo "No tests to run."' diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 2d364b3e3b35..1a90eab73089 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -7,32 +7,23 @@ name: test on: push: branches: [trunk] - paths: - # Conservatively run the tests. However, skip them if the only paths in - # the pull request match files that we know don't impact the build. - - '**' - - '!**/*.md' - - '!LICENSE' - - '!CODEOWNERS' - - '!.git*' + paths-ignore: + - '**/*.md' + - 'LICENSE' + - 'CODEOWNERS' + - '.git*' pull_request_target: - paths: - # Conservatively run the tests. However, skip them if the only paths in - # the pull request match files that we know don't impact the build. - - '**' - - '!**/*.md' - - '!LICENSE' - - '!CODEOWNERS' - - '!.git*' + paths-ignore: + - '**/*.md' + - 'LICENSE' + - 'CODEOWNERS' + - '.git*' merge_group: - paths: - # Conservatively run the tests. However, skip them if the only paths in - # the pull request match files that we know don't impact the build. - - '**' - - '!**/*.md' - - '!LICENSE' - - '!CODEOWNERS' - - '!.git*' + paths-ignore: + - '**/*.md' + - 'LICENSE' + - 'CODEOWNERS' + - '.git*' # Cancel previous workflows on the PR when there are multiple fast commits. # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency