diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 7766930..0c4c101 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c28954f..519ea59 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -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