TeamCity Services Weekly Diff Check #77
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: TeamCity Services Weekly Diff Check | |
permissions: read-all | |
on: | |
# Enable ad hoc checks | |
workflow_dispatch: | |
# Scheduled checks to catch edge cases | |
schedule: | |
# Every Monday and Tuesday morning | |
- cron: '0 4 * * 1-2' | |
jobs: | |
teamcity-services-diff-check: | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.2 | |
- name: TeamCity Google Provider Generate | |
uses: ./.github/actions/build-downstream | |
with: | |
repo: 'terraform-provider-google' | |
token: '$GITHUB_TOKEN' | |
# The path where GA/Beta providers are generated is grabbed from the OUTPUT_PATH that's set in build_downstream.yaml | |
# export OUTPUT_PATH=$GOPATH/src/github.com/$UPSTREAM_OWNER/$GH_REPO | |
# OUTPUT_PATH changes after each generate (GA/beta) | |
- name: Set GOOGLE_REPO_PATH to path where GA provider was generated | |
run: echo "GOOGLE_REPO_PATH=${{ env.OUTPUT_PATH}}" >> $GITHUB_ENV | |
- name: TeamCity Google Beta Provider Generate | |
uses: ./.github/actions/build-downstream | |
with: | |
repo: 'terraform-provider-google-beta' | |
token: '$GITHUB_TOKEN' | |
- name: Set GOOGLE_BETA_REPO_PATH to path where beta provider was generated | |
run: echo "GOOGLE_BETA_REPO_PATH=${{ env.OUTPUT_PATH}}" >> $GITHUB_ENV | |
- name: Check that new services have been added to the TeamCity configuration code | |
run: | | |
# Create lists of service packages in providers. Need to cd into repos where go.mod is to do this command. | |
cd ${{env.GOOGLE_REPO_PATH}} | |
go list -f '{{.Name}}' ${{env.GOOGLE_REPO_PATH}}/google/services/... > $GITHUB_WORKSPACE/provider_services_ga.txt | |
cd ${{env.GOOGLE_BETA_REPO_PATH}} | |
go list -f '{{.Name}}' ${{env.GOOGLE_BETA_REPO_PATH}}/google-beta/services/... > $GITHUB_WORKSPACE/provider_services_beta.txt | |
# Run tool to compare service packages in the providers vs those listed in TeamCity config files | |
cd $GITHUB_WORKSPACE | |
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 | |
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 |