mirror of
https://github.com/Sea-Haven-Industries/payments-dashboard.git
synced 2026-10-02 10:53:25 +00:00
* ci: aggregate test and Terraform as ci-complete Converted callers emit that check so this repo can leave the ci / ci ruleset. * ci: add Prettier format and format:check The autofix prettier preset runs npm run format, and CI fails closed when the tree is unformatted.
77 lines
2.1 KiB
YAML
77 lines
2.1 KiB
YAML
name: CI
|
|
|
|
# Parallel test and Terraform portions. The required check is ci-complete.
|
|
|
|
on:
|
|
pull_request:
|
|
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: prettier,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:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
with:
|
|
node-version: "24"
|
|
cache: npm
|
|
|
|
- name: Install
|
|
run: npm ci
|
|
|
|
- name: Check format
|
|
run: npm run format:check
|
|
|
|
- name: Test
|
|
run: npm test
|
|
|
|
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"
|
|
working-directory: terraform
|
|
app-paths: |
|
|
src/
|
|
package.json
|
|
package-lock.json
|
|
|
|
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: Require portions
|
|
env:
|
|
TEST: ${{ needs.test.result }}
|
|
TERRAFORM: ${{ needs.terraform.result }}
|
|
run: |
|
|
set -euo pipefail
|
|
test "${TEST}" = success
|
|
test "${TERRAFORM}" = success
|