ci: aggregate test and Terraform as ci-complete

Converted callers emit that check so this repo can leave the ci / ci ruleset.
This commit is contained in:
Adam Moussa 2026-10-01 21:13:22 -04:00
parent 7c2c806339
commit 1f6e312537
No known key found for this signature in database
2 changed files with 34 additions and 27 deletions

View file

@ -1,16 +1,31 @@
name: CI
# Parallel test and Terraform portions. The required check is ci-complete.
on:
pull_request:
branches: [main]
branches: [main, hotfix/**, release/**]
merge_group:
push:
branches: [hotfix/**, release/**]
permissions:
contents: read
jobs:
autofix:
if: github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork
uses: Sea-Haven-Industries/.github/.github/workflows/ci-autofix.yaml@47185fa602dffddb8297db5f3525d7c9bc05d7cd # v1.0.21
permissions:
contents: write
secrets: inherit
with:
presets: terraform
test:
name: Test
needs: autofix
if: always() && !cancelled() && (needs.autofix.result == 'skipped' || needs.autofix.outputs.committed != 'true')
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
@ -31,6 +46,8 @@ jobs:
terraform:
name: Terraform
needs: autofix
if: always() && !cancelled() && (needs.autofix.result == 'skipped' || needs.autofix.outputs.committed != 'true')
uses: Sea-Haven-Industries/.github/.github/workflows/ci-terraform.yaml@47185fa602dffddb8297db5f3525d7c9bc05d7cd # v1.0.21
with:
terraform-version: "1.16.0"
@ -40,33 +57,18 @@ jobs:
package.json
package-lock.json
ci:
name: ci / ci
needs: [test, terraform]
if: ${{ always() && !cancelled() }}
ci-complete:
name: ci-complete
needs: [autofix, test, terraform]
if: always() && !cancelled() && (needs.autofix.result == 'skipped' || needs.autofix.outputs.committed != 'true')
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check jobs
- name: Require portions
env:
TEST_RESULT: ${{ needs.test.result }}
TERRAFORM_RESULT: ${{ needs.terraform.result }}
TEST: ${{ needs.test.result }}
TERRAFORM: ${{ needs.terraform.result }}
run: |
set -euo pipefail
fail=0
check() {
local name="$1"
local result="$2"
case "${result}" in
success)
echo "${name}: ${result}"
;;
*)
echo "${name}: ${result}" >&2
fail=1
;;
esac
}
check test "${TEST_RESULT}"
check terraform "${TERRAFORM_RESULT}"
exit "${fail}"
test "${TEST}" = success
test "${TERRAFORM}" = success

View file

@ -71,15 +71,20 @@ describe("HCP Terraform seam (PLAT-79)", () => {
assert.match(deploy, /function-keys: process_csv,slack_app_home,fetch_boa,expense_receiver,expense_processor/);
});
it("runs npm test and the Terraform callable behind ci / ci", () => {
it("runs npm test and the Terraform callable behind ci-complete", () => {
assert.doesNotMatch(ci, /ci-typescript-cdk/);
assert.doesNotMatch(ci, /run-sam-validate/);
assert.match(ci, /npm test/);
assert.match(ci, /ci-terraform\.yaml@47185fa602dffddb8297db5f3525d7c9bc05d7cd/);
assert.match(ci, /ci-autofix\.yaml@47185fa602dffddb8297db5f3525d7c9bc05d7cd/);
assert.match(ci, /presets: terraform/);
assert.match(ci, /src\//);
assert.match(ci, /package\.json/);
assert.match(ci, /package-lock\.json/);
assert.match(ci, /name: ci \/ ci/);
assert.match(ci, /hotfix\/\*\*/);
assert.match(ci, /release\/\*\*/);
assert.match(ci, /name: ci-complete/);
assert.doesNotMatch(ci, /name: ci \/ ci/);
});
it("names the five live functions", () => {