Skip to content

Commit 7e1f05b

Browse files
committed
ci: add scheduled tests
1 parent 7150364 commit 7e1f05b

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Scheduled Tests
2+
3+
on:
4+
schedule:
5+
- cron: "0 16 * * *"
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
test:
13+
name: Terraform Provider Acceptance Tests
14+
runs-on: ubuntu-latest
15+
concurrency:
16+
group: acc-tests-netlify
17+
timeout-minutes: 15
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
terraform:
22+
- "1.0.*"
23+
steps:
24+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
25+
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
26+
with:
27+
go-version-file: "go.mod"
28+
cache: true
29+
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
30+
with:
31+
terraform_version: ${{ matrix.terraform }}
32+
terraform_wrapper: false
33+
- run: go mod download
34+
- name: Run acceptance tests
35+
env:
36+
TF_ACC: "1"
37+
NETLIFY_API_TOKEN: ${{ secrets.NETLIFY_API_TOKEN }}
38+
MAX_ATTEMPTS: ${{ github.event_name == 'schedule' && '3' || '1' }}
39+
run: |
40+
for attempt in $(seq 1 "$MAX_ATTEMPTS"); do
41+
echo "::group::Attempt $attempt of $MAX_ATTEMPTS"
42+
if go test -v -cover ./internal/provider/; then
43+
echo "::endgroup::"
44+
exit 0
45+
fi
46+
echo "::endgroup::"
47+
done
48+
exit 1
49+
timeout-minutes: 10

0 commit comments

Comments
 (0)