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 tidy
make bootstrap make bootstrap
checks: checks:
uses: ./.github/workflows/checks.yaml
needs: [mods] 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: compile:
needs: [mods, checks] needs: [mods, checks]
strategy: strategy:
@ -129,4 +118,3 @@ jobs:
sudo -E env "PATH=$PATH" make test-nomad sudo -E env "PATH=$PATH" make test-nomad
permissions: permissions:
contents: read contents: read

View File

@ -96,11 +96,11 @@ resource "azurerm_network_security_rule" "hashistack-sgr-8500" {
} }
resource "azurerm_public_ip" "hashistack-server-public-ip" { resource "azurerm_public_ip" "hashistack-server-public-ip" {
count = "${var.server_count}" count = "${var.server_count}"
name = "hashistack-server-ip-${count.index}" name = "hashistack-server-ip-${count.index}"
location = "${var.location}" location = "${var.location}"
resource_group_name = "${azurerm_resource_group.hashistack.name}" resource_group_name = "${azurerm_resource_group.hashistack.name}"
allocation_method = "Static" allocation_method = "Static"
} }
resource "azurerm_network_interface" "hashistack-server-ni" { resource "azurerm_network_interface" "hashistack-server-ni" {
@ -173,11 +173,11 @@ data "template_file" "user_data_server" {
} }
resource "azurerm_public_ip" "hashistack-client-public-ip" { resource "azurerm_public_ip" "hashistack-client-public-ip" {
count = "${var.client_count}" count = "${var.client_count}"
name = "hashistack-client-ip-${count.index}" name = "hashistack-client-ip-${count.index}"
location = "${var.location}" location = "${var.location}"
resource_group_name = "${azurerm_resource_group.hashistack.name}" resource_group_name = "${azurerm_resource_group.hashistack.name}"
allocation_method = "Static" allocation_method = "Static"
} }
resource "azurerm_network_interface" "hashistack-client-ni" { resource "azurerm_network_interface" "hashistack-client-ni" {