Nightly Acceptance Tests #1240
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nightly Acceptance Tests | |
on: | |
schedule: | |
# Will run at 00:00 every day | |
- cron: "0 0 * * *" | |
jobs: | |
nightly: | |
strategy: | |
fail-fast: false | |
matrix: | |
products: | |
- Account | |
- AppleSilicon | |
- Baremetal | |
- Billing | |
- Block | |
- Cockpit | |
- Domain | |
- DocumentDB | |
- Function | |
- Container | |
- Iam | |
- Instance | |
- Iot | |
- IPAM | |
- Job | |
- K8S | |
- Lb | |
- Marketplace | |
- MNQ | |
- Object | |
- Rdb | |
- Redis | |
- Registry | |
- Secret | |
- ServerlessSQLDB | |
- Tem | |
- VPC | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.21 | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Run Acceptance Tests | |
run: go test -v ./... -timeout=4h -run "TestAccScaleway(DataSource)?${{ matrix.products }}.*" | |
env: | |
TF_LOG: DEBUG | |
# https://www.terraform.io/docs/extend/testing/acceptance-tests/index.html#running-acceptance-tests | |
TF_ACC: 1 | |
# Enable recording with the cassette system. By doing so, we ensure that real HTTPS requests are made. | |
TF_UPDATE_CASSETTES: true | |
TF_TEST_DOMAIN: scaleway-terraform.com | |
TF_TEST_DOMAIN_ZONE: tf | |
SCW_DEBUG: 1 | |
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY }} | |
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }} | |
SCW_DEFAULT_ORGANIZATION_ID: ${{ secrets.SCW_DEFAULT_ORGANIZATION_ID }} | |
SCW_DEFAULT_PROJECT_ID: ${{ secrets.SCW_DEFAULT_PROJECT_ID }} | |
- name: Ping on failure | |
if: ${{ failure() }} | |
run: | | |
curl -X POST -H 'Content-type: application/json' \ | |
--data '{ | |
"blocks": [ | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": "'"Nightly workflow failed: <https://github.com/scaleway/terraform-provider-scaleway/actions/runs/${GITHUB_RUN_ID}|${FAILED_PRODUCT}>"'" | |
} | |
} | |
] | |
}' \ | |
${SLACK_WEBHOOK_NIGHTLY}; | |
env: | |
SLACK_WEBHOOK_NIGHTLY: ${{ secrets.SLACK_WEBHOOK_NIGHTLY }} | |
FAILED_PRODUCT: ${{ matrix.products }} | |
# sweeper needs to run after nightly completed | |
# no matter what are the results of the jobs | |
sweeper: | |
runs-on: ubuntu-latest | |
needs: nightly | |
if: always() | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.21 | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Run sweepers | |
run: make sweep | |
env: | |
TF_TEST_DOMAIN: scaleway-terraform.com | |
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY }} | |
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }} | |
SCW_DEFAULT_ORGANIZATION_ID: ${{ secrets.SCW_DEFAULT_ORGANIZATION_ID }} | |
SCW_DEFAULT_PROJECT_ID: ${{ secrets.SCW_DEFAULT_PROJECT_ID }} |