Skip to content

Commit

Permalink
Add CI workflow to sweep nightly
Browse files Browse the repository at this point in the history
Adds a CI workflow that will run the Terraform sweepers each night.
  • Loading branch information
mitchnielsen committed Jan 16, 2025
1 parent 3c39794 commit 930f84c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/acceptance-tests-sweepers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow runs the Terraform acceptance tests sweepers every day.
name: Acceptance Tests - Sweepers

"on":
# Run at 7 AM UTC every day (2 AM EST)
schedule:
- cron: '0 7 * * *'
# Run manually
workflow_dispatch: {}

permissions: {}

jobs:
sweepers:
permissions:
contents: read
name: Run Sweepers
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Install gotestsum
run: go install gotest.tools/gotestsum@latest
- name: Run sweeper tests
run: make testacc-sweepers
env:
PREFECT_API_URL: ${{ secrets.ACC_TEST_PREFECT_API_URL }}
PREFECT_API_KEY: ${{ secrets.ACC_TEST_PREFECT_API_KEY }}
PREFECT_CLOUD_ACCOUNT_ID: ${{ secrets.ACC_TEST_PREFECT_CLOUD_ACCOUNT_ID }}
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ testacc:
TF_ACC=1 make test
.PHONY: testacc

# NOTE: Acceptance Test sweepers delete real infrastructure against a dedicated testing account
testacc-sweepers:
go test ./internal/sweep -v -sweep=all
.PHONY: testacc-sweepers

testacc-dev:
./scripts/testacc-dev $(TESTS) $(LOG_LEVEL) $(SWEEP)
.PHONY: testacc-dev
Expand Down

0 comments on commit 930f84c

Please sign in to comment.