From 512b1711bb1ab0287f871729f256e74eebb661cc Mon Sep 17 00:00:00 2001 From: Sarah French <15078782+SarahFrench@users.noreply.github.com> Date: Fri, 16 Feb 2024 13:34:28 +0000 Subject: [PATCH] Add GHA to run TeamCity config tests on PRs editing `.teamcity` (#9954) * Add GHA to run TeamCity config tests on PRs editing `.teamcity` * Push failing test to check GHA detects it * Remove intentionally failing test --- .github/workflows/teamcity-pr-checks.yml | 46 ++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/teamcity-pr-checks.yml diff --git a/.github/workflows/teamcity-pr-checks.yml b/.github/workflows/teamcity-pr-checks.yml new file mode 100644 index 000000000000..bea371247b07 --- /dev/null +++ b/.github/workflows/teamcity-pr-checks.yml @@ -0,0 +1,46 @@ +name: TeamCity Configuration Tests +permissions: read-all + +on: + workflow_dispatch: + pull_request: + paths: + - '.github/workflows/teamcity-pr-checks.yml' + - 'mmv1/third_party/terraform/!.teamcity' + + +jobs: + teamcity-config-tests: + runs-on: ubuntu-22.04 + steps: + - name: Checkout Repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + fetch-depth: 0 + + - name: Setup Java + uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0 + with: + distribution: zulu + java-version: 17 + java-package: jdk + + - name: Cache Maven files + uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - name: Download TeamCity Tools + run : | + cd mmv1/third_party/terraform/.teamcity + make tools + + # Running the tests twice ensures that the tests are discovered and run + - name: Run TeamCity Tests + run : | + cd mmv1/third_party/terraform/.teamcity + make test + make test \ No newline at end of file