Skip to content

fix(cloudformation): keep CloudFront CustomErrorResponses through provisioning #3

fix(cloudformation): keep CloudFront CustomErrorResponses through provisioning

fix(cloudformation): keep CloudFront CustomErrorResponses through provisioning #3

Workflow file for this run

name: Terraform Acceptance
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CARGO_TERM_COLOR: always
jobs:
changes:
runs-on: ubuntu-latest
timeout-minutes: 60
outputs:
code: ${{ steps.detect.outputs.code || 'true' }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- if: github.event_name == 'pull_request'
id: detect
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
with:
predicate-quantifier: 'every'
filters: |
code:
- '**'
- '!**/*.md'
- '!**/*.txt'
- '!**/*.html'
- '!docs/**'
- '!website/**'
- '!LICENSE'
- '!.gitignore'
tfacc-matrix:
needs: changes
if: needs.changes.outputs.code == 'true'
runs-on: ubuntu-latest
timeout-minutes: 60
outputs:
shards: ${{ steps.m.outputs.shards }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: ./.github/actions/free-disk
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- name: Emit shard matrix
run: cargo run -q -p fakecloud-tfacc --bin tfacc_shards > shards.json
- id: m
run: echo "shards=$(cat shards.json)" >> "$GITHUB_OUTPUT"
# Build fakecloud once here so every matrix job can download the
# binary as an artifact instead of rebuilding from scratch.
- name: Build fakecloud
run: cargo build --bin fakecloud
- name: Upload fakecloud binary
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: fakecloud-binary-tfacc
path: target/debug/fakecloud
if-no-files-found: error
retention-days: 1
tfacc:
name: tfacc ${{ matrix.name }}
needs: [changes, tfacc-matrix]
if: needs.changes.outputs.code == 'true'
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.tfacc-matrix.outputs.shards) }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: ./.github/actions/free-disk
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: "1.23.x"
- uses: hashicorp/setup-terraform@dfe3c3f87815947d99a8997f908cb6525fc44e9e # v4.0.1
with:
terraform_version: "1.14.5"
terraform_wrapper: false
# Cache the upstream provider source and Go caches together — the
# checkout dominates first-run time (~300MB shallow clone) and the Go
# module + build caches dominate go-test compile time.
- name: Cache Go + provider source
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
~/.cache/go-build
~/go/pkg/mod
target/tfacc
key: tfacc-${{ runner.os }}-${{ hashFiles('crates/fakecloud-tfacc/src/lib.rs') }}
restore-keys: |
tfacc-${{ runner.os }}-
- name: Download fakecloud binary
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: fakecloud-binary-tfacc
path: target/debug
- name: Mark fakecloud binary executable
run: chmod +x target/debug/fakecloud
- name: Disk diagnostics before tests
run: df -h
- name: Run ${{ matrix.name }} acceptance tests
run: cargo test -p fakecloud-tfacc --test acc ${{ matrix.test_fn }} -- --nocapture
- name: Disk diagnostics after tests
if: always()
run: df -h
- name: Upload failing go test output
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: tfacc-${{ matrix.name }}-failure-log
path: target/tfacc/logs/${{ matrix.service }}-failure.log
if-no-files-found: ignore
retention-days: 7