|
12 | 12 |
|
13 | 13 | jobs:
|
14 | 14 | teamcity-services-diff-check:
|
15 |
| - env: |
16 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
17 |
| - runs-on: ubuntu-22.04 |
18 |
| - steps: |
19 |
| - - name: Checkout Repository |
20 |
| - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.2 |
21 |
| - - name: TeamCity Google Provider Generate |
22 |
| - uses: ./.github/actions/build-downstream |
23 |
| - with: |
24 |
| - repo: 'terraform-provider-google' |
25 |
| - token: '$GITHUB_TOKEN' |
26 |
| - # The path where GA/Beta providers are generated is grabbed from the OUTPUT_PATH that's set in build_downstream.yaml |
27 |
| - # export OUTPUT_PATH=$GOPATH/src/github.com/$UPSTREAM_OWNER/$GH_REPO |
28 |
| - # OUTPUT_PATH changes after each generate (GA/beta) |
29 |
| - - name: Set GOOGLE_REPO_PATH to path where GA provider was generated |
30 |
| - run: echo "GOOGLE_REPO_PATH=${{ env.OUTPUT_PATH}}" >> $GITHUB_ENV |
31 |
| - - name: TeamCity Google Beta Provider Generate |
32 |
| - uses: ./.github/actions/build-downstream |
33 |
| - with: |
34 |
| - repo: 'terraform-provider-google-beta' |
35 |
| - token: '$GITHUB_TOKEN' |
36 |
| - - name: Set GOOGLE_BETA_REPO_PATH to path where beta provider was generated |
37 |
| - run: echo "GOOGLE_BETA_REPO_PATH=${{ env.OUTPUT_PATH}}" >> $GITHUB_ENV |
38 |
| - - name: Check that new services have been added to the TeamCity configuration code |
39 |
| - run: | |
40 |
| - # Create lists of service packages in providers. Need to cd into repos where go.mod is to do this command. |
41 |
| - cd ${{env.GOOGLE_REPO_PATH}} |
42 |
| - go list -f '{{.Name}}' ${{env.GOOGLE_REPO_PATH}}/google/services/... > $GITHUB_WORKSPACE/provider_services_ga.txt |
43 |
| - cd ${{env.GOOGLE_BETA_REPO_PATH}} |
44 |
| - go list -f '{{.Name}}' ${{env.GOOGLE_BETA_REPO_PATH}}/google-beta/services/... > $GITHUB_WORKSPACE/provider_services_beta.txt |
| 15 | + if: github.repository == 'GoogleCloudPlatform/magic-modules' |
| 16 | + env: |
| 17 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 18 | + runs-on: ubuntu-22.04 |
| 19 | + steps: |
| 20 | + - name: Checkout Repository |
| 21 | + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.2 |
| 22 | + - name: TeamCity Google Provider Generate |
| 23 | + uses: ./.github/actions/build-downstream |
| 24 | + with: |
| 25 | + repo: 'terraform-provider-google' |
| 26 | + token: '$GITHUB_TOKEN' |
| 27 | + # The path where GA/Beta providers are generated is grabbed from the OUTPUT_PATH that's set in build_downstream.yaml |
| 28 | + # export OUTPUT_PATH=$GOPATH/src/github.com/$UPSTREAM_OWNER/$GH_REPO |
| 29 | + # OUTPUT_PATH changes after each generate (GA/beta) |
| 30 | + - name: Set GOOGLE_REPO_PATH to path where GA provider was generated |
| 31 | + run: echo "GOOGLE_REPO_PATH=${{ env.OUTPUT_PATH}}" >> $GITHUB_ENV |
| 32 | + - name: TeamCity Google Beta Provider Generate |
| 33 | + uses: ./.github/actions/build-downstream |
| 34 | + with: |
| 35 | + repo: 'terraform-provider-google-beta' |
| 36 | + token: '$GITHUB_TOKEN' |
| 37 | + - name: Set GOOGLE_BETA_REPO_PATH to path where beta provider was generated |
| 38 | + run: echo "GOOGLE_BETA_REPO_PATH=${{ env.OUTPUT_PATH}}" >> $GITHUB_ENV |
| 39 | + - name: Check that new services have been added to the TeamCity configuration code |
| 40 | + run: | |
| 41 | + # Create lists of service packages in providers. Need to cd into repos where go.mod is to do this command. |
| 42 | + cd ${{env.GOOGLE_REPO_PATH}} |
| 43 | + go list -f '{{.Name}}' ${{env.GOOGLE_REPO_PATH}}/google/services/... > $GITHUB_WORKSPACE/provider_services_ga.txt |
| 44 | + cd ${{env.GOOGLE_BETA_REPO_PATH}} |
| 45 | + go list -f '{{.Name}}' ${{env.GOOGLE_BETA_REPO_PATH}}/google-beta/services/... > $GITHUB_WORKSPACE/provider_services_beta.txt |
45 | 46 |
|
46 |
| - # Run tool to compare service packages in the providers vs those listed in TeamCity config files |
47 |
| - cd $GITHUB_WORKSPACE |
48 |
| - go run ./tools/teamcity-diff-check/main.go -version=ga -provider_services=./provider_services_ga.txt -teamcity_services=./mmv1/third_party/terraform/.teamcity/components/inputs/services_ga.kt |
49 |
| - go run ./tools/teamcity-diff-check/main.go -version=beta -provider_services=./provider_services_beta.txt -teamcity_services=./mmv1/third_party/terraform/.teamcity/components/inputs/services_beta.kt |
| 47 | + # Run tool to compare service packages in the providers vs those listed in TeamCity config files |
| 48 | + cd $GITHUB_WORKSPACE |
| 49 | + go run ./tools/teamcity-diff-check/main.go -version=ga -provider_services=./provider_services_ga.txt -teamcity_services=./mmv1/third_party/terraform/.teamcity/components/inputs/services_ga.kt |
| 50 | + go run ./tools/teamcity-diff-check/main.go -version=beta -provider_services=./provider_services_beta.txt -teamcity_services=./mmv1/third_party/terraform/.teamcity/components/inputs/services_beta.kt |
0 commit comments