Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cicd(master): fix missing acc test secrets #72

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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