ci: run 'make check' as reusable workflow (#17600)

Some of the paths ignored by `test-core.yaml` need to be checked by
`make check`. The `checks.yaml` workflow run on these paths and can also
be used as a reusable workflow.
This commit is contained in:
Luiz Aoqui 2023-06-20 03:17:13 -04:00 committed by GitHub
parent d797da4a3c
commit 4b33bbd9c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 47 additions and 23 deletions

36
.github/workflows/checks.yaml vendored Normal file
View File

@ -0,0 +1,36 @@
# Run 'make check' on paths ignored by test-core.yaml.
name: Run checks
on:
pull_request:
paths:
- 'demo/**'
- 'e2e/terraform/**'
- 'terraform/**'
- 'website/**'
push:
branches:
- 'main'
- 'release/**'
paths:
- 'demo/**'
- 'e2e/terraform/**'
- 'terraform/**'
- 'website/**'
workflow_call:
jobs:
checks:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
fetch-depth: 0 # needs tags for checkproto
- uses: hashicorp/setup-golang@v1
- name: Run make check
run: |
make missing
make bootstrap
make check
permissions:
contents: read

View File

@ -57,19 +57,8 @@ jobs:
make tidy
make bootstrap
checks:
uses: ./.github/workflows/checks.yaml
needs: [mods]
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
fetch-depth: 0 # needs tags for checkproto
- uses: hashicorp/setup-golang@v1
- name: Run make check
run: |
make missing
make bootstrap
make check
compile:
needs: [mods, checks]
strategy:
@ -129,4 +118,3 @@ jobs:
sudo -E env "PATH=$PATH" make test-nomad
permissions:
contents: read