diff --git a/.github/workflows/test_aws_integration.yaml b/.github/workflows/test_aws_integration.yaml index b6c27c938..0a5352ecb 100644 --- a/.github/workflows/test_aws_integration.yaml +++ b/.github/workflows/test_aws_integration.yaml @@ -32,12 +32,32 @@ env: AWS_DEFAULT_REGION: "us-west-2" NEBARI_GH_BRANCH: ${{ github.event.inputs.branch || 'develop' }} NEBARI_IMAGE_TAG: ${{ github.event.inputs.image-tag || 'main' }} - TF_LOG: ${{ github.event.inputs.tf-log-level || 'info' }} - + TF_LOG: ${{ github.event.inputs.tf-log-level || 'info' }}∏ + NO_PROVIDER_CREDENTIALS_aws: false jobs: + # Used to skip cloud provider checks due to "jobs" not supporting {{ env }} variables contexts. + check-for-credentials_aws: + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + outputs: + provider_credentials_aws: ${{ steps.flag-check.outputs.provider_credentials_aws }} + steps: + - name: Check if user wants to run AWS integration based on credentials + id: flag-check + run: | + if [ "${{ env.NO_PROVIDER_CREDENTIALS_aws }}" == "true" ]; then + echo "::set-output name=provider_credentials_aws::0" + else + echo "::set-output name=provider_credentials_aws::1" + fi + test-aws-integration: runs-on: ubuntu-latest + needs: check-for-credentials_aws + if: ${{ needs.check-for-credentials.outputs.provider_credentials_aws == '1' }} permissions: id-token: write contents: read diff --git a/.github/workflows/test_azure_integration.yaml b/.github/workflows/test_azure_integration.yaml index fbb023101..7eb11fed2 100644 --- a/.github/workflows/test_azure_integration.yaml +++ b/.github/workflows/test_azure_integration.yaml @@ -31,10 +31,34 @@ env: NEBARI_GH_BRANCH: ${{ github.event.inputs.branch || 'develop' }} NEBARI_IMAGE_TAG: ${{ github.event.inputs.image-tag || 'main' }} TF_LOG: ${{ github.event.inputs.tf-log-level || 'info' }} + NO_PROVIDER_CREDENTIALS_azure: false jobs: + # Used to skip cloud provider checks due to "jobs" not supporting {{ env }} variables contexts + check-for-credentials: + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + + outputs: + provider_credentials_azure: ${{ steps.flag-check.outputs.provider_credentials_azure }} + + steps: + + - name: Check if user wants to run Azure integration based on credentials + id: flag-check + run: | + if [ "${{ env.NO_PROVIDER_CREDENTIALS_azure }}" == "true" ]; then + echo "::set-output name=provider_credentials_azure::0" + else + echo "::set-output name=provider_credentials_azure::1" + fi + test-azure-integration: runs-on: ubuntu-latest + needs: check-for-credentials + if: ${{ needs.check-for-credentials.outputs.provider_credentials_azure == '1' }} permissions: id-token: write contents: read diff --git a/.github/workflows/test_do_integration.yaml b/.github/workflows/test_do_integration.yaml index ef0cbb235..74cec545a 100644 --- a/.github/workflows/test_do_integration.yaml +++ b/.github/workflows/test_do_integration.yaml @@ -31,11 +31,33 @@ env: NEBARI_GH_BRANCH: ${{ github.event.inputs.branch || 'develop' }} NEBARI_IMAGE_TAG: ${{ github.event.inputs.image-tag || 'main' }} TF_LOG: ${{ github.event.inputs.tf-log-level || 'info' }} + NO_PROVIDER_CREDENTIALS_do: false jobs: + # Used to skip cloud provider checks due to "jobs" not supporting {{ env }} variables contexts + check-for-credentials: + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + outputs: + provider_credentials_do: ${{ steps.flag-check.outputs.provider_credentials_do }} + steps: + - name: Check if user wants to run Digital Ocean integration based on credentials + id: flag-check + run: | + if [ "${{ env.NO_PROVIDER_CREDENTIALS_do }}" == "true" ]; then + echo "::set-output name=provider_credentials_do::0" + else + echo "::set-output name=provider_credentials_do::1" + fi + + test-do-integration: runs-on: ubuntu-latest + needs: check-for-credentials + if: ${{ needs.check-for-credentials.outputs.provider_credentials_do == '1' }} permissions: id-token: write contents: read diff --git a/.github/workflows/test_gcp_integration.yaml b/.github/workflows/test_gcp_integration.yaml index 6ba1921f4..1fe9e4f8d 100644 --- a/.github/workflows/test_gcp_integration.yaml +++ b/.github/workflows/test_gcp_integration.yaml @@ -31,11 +31,31 @@ env: NEBARI_GH_BRANCH: ${{ github.event.inputs.branch || 'develop' }} NEBARI_IMAGE_TAG: ${{ github.event.inputs.image-tag || 'main' }} TF_LOG: ${{ github.event.inputs.tf-log-level || 'info' }} - + NO_PROVIDER_CREDENTIALS_gcp: false jobs: + # Used to skip cloud provider checks due to "jobs" not supporting {{ env }} variables contexts + check-for-credentials: + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + outputs: + provider_credentials_gcp: ${{ steps.flag-check.outputs.provider_credentials_gcp }} + steps: + - name: Check if user wants to run GCP integration based on credentials + id: flag-check + run: | + if [ "${{ env.NO_PROVIDER_CREDENTIALS_gcp }}" == "true" ]; then + echo "::set-output name=provider_credentials_gcp::0" + else + echo "::set-output name=provider_credentials_gcp::1" + fi + test-gcp-integration: runs-on: ubuntu-latest + needs: check-for-credentials + if: ${{ needs.check-for-credentials.outputs.provider_credentials_gcp == '1' }} permissions: id-token: write contents: read