Skip to content

Commit

Permalink
cicd(master): fix missing acc test secrets (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
ndopj authored Dec 6, 2023
1 parent ac5b666 commit ddee675
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 9 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ permissions:
jobs:
tests:
uses: ./.github/workflows/test.yml
with:
mc_api_key_id: ${{ secrets.ACC_TEST_MC_API_KEY_ID }}
mc_api_key_token: ${{ secrets.ACC_TEST_MC_API_KEY_TOKEN }}
bq_service_account: ${{ secrets.ACC_TEST_BQ_SERVICE_ACCOUNT }}
pg_host: ${{ secrets.ACC_TEST_PG_HOST }}
pg_port: ${{ secrets.ACC_TEST_PG_PORT }}
pg_database: ${{ secrets.ACC_TEST_PG_DATABASE }}
pg_user: ${{ secrets.ACC_TEST_PG_USER }}
pg_password: ${{ secrets.ACC_TEST_PG_PASSWORD }}
coverage-check:
needs: tests
runs-on: ubuntu-latest
Expand Down
51 changes: 42 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,43 @@
name: Terraform Provider Tests

on:
workflow_call:
pull_request:
branches:
- master
workflow_call:
inputs:
mc_api_key_id:
description: 'Monte Carlo API Key ID'
required: true
type: string
mc_api_key_token:
description: 'Monte Carlo API Key Token'
required: true
type: string
bq_service_account:
description: 'BigQuery Service Account'
required: true
type: string
pg_host:
description: 'Postgres Host'
required: true
type: string
pg_port:
description: 'Postgres Port'
required: true
type: string
pg_database:
description: 'Postgres Database'
required: true
type: string
pg_user:
description: 'Postgres User'
required: true
type: string
pg_password:
description: 'Postgres Password'
required: true
type: string

permissions:
# Permission for checking out code
Expand All @@ -28,14 +61,14 @@ jobs:
go test -v ./... -coverprofile=coverage.out
env:
TF_ACC: '1'
MC_API_KEY_ID: ${{ secrets.ACC_TEST_MC_API_KEY_ID }}
MC_API_KEY_TOKEN: ${{ secrets.ACC_TEST_MC_API_KEY_TOKEN }}
BQ_SERVICE_ACCOUNT: ${{ secrets.ACC_TEST_BQ_SERVICE_ACCOUNT }}
PG_HOST: ${{ secrets.ACC_TEST_PG_HOST }}
PG_PORT: ${{ secrets.ACC_TEST_PG_PORT }}
PG_DATABASE: ${{ secrets.ACC_TEST_PG_DATABASE }}
PG_USER: ${{ secrets.ACC_TEST_PG_USER }}
PG_PASSWORD: ${{ secrets.ACC_TEST_PG_PASSWORD }}
MC_API_KEY_ID: ${{ inputs.mc_api_key_id || secrets.ACC_TEST_MC_API_KEY_ID }}
MC_API_KEY_TOKEN: ${{ inputs.mc_api_key_token || secrets.ACC_TEST_MC_API_KEY_TOKEN }}
BQ_SERVICE_ACCOUNT: ${{ inputs.bq_service_account || secrets.ACC_TEST_BQ_SERVICE_ACCOUNT }}
PG_HOST: ${{ inputs.pg_host || secrets.ACC_TEST_PG_HOST }}
PG_PORT: ${{ inputs.pg_port || secrets.ACC_TEST_PG_PORT }}
PG_DATABASE: ${{ inputs.pg_database || secrets.ACC_TEST_PG_DATABASE }}
PG_USER: ${{ inputs.pg_user || secrets.ACC_TEST_PG_USER }}
PG_PASSWORD: ${{ inputs.pg_password || secrets.ACC_TEST_PG_PASSWORD }}
- uses: actions/upload-artifact@v3
with:
name: coverage
Expand Down

0 comments on commit ddee675

Please sign in to comment.