diff --git a/.github/workflows/stage.yml b/.github/workflows/stage.yml index 803b8e3..7f70dd5 100644 --- a/.github/workflows/stage.yml +++ b/.github/workflows/stage.yml @@ -18,6 +18,7 @@ on: paths: - "generated/**" - "src/**" + - "test/**" - "package-lock.json" - "package.json" - "tsconfig.json" @@ -44,6 +45,31 @@ jobs: cache: npm registry-url: 'https://npm.pkg.github.com' + - name: Setup Java 17 + uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 17 + cache: maven + + - name: setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.9' + cache: 'pip' + - name: get Python location + id: python-location + run: | + echo "python-bin-location=$(echo $pythonLocation)/bin" >> $GITHUB_OUTPUT + + - name: setup go + uses: actions/setup-go@v5 + with: + go-version: '1.20.1' + + - name: Setup Gradle + uses: gradle/gradle-build-action@v3 + - name: Configure git run: | git config user.name "${{ github.actor }}" @@ -60,6 +86,29 @@ jobs: - name: Compile project run: npm run compile + - name: Check if re-test is needed + id: test-check + uses: zvigrinberg/git-retest-checkup-action@v1.1 + with: + base-ref: ${{ github.base_ref }} + pr-ref: ${{ github.head_ref }} + file-pattern-regex: "^src/.*|^test/.*" + + - name: re-test Unit-Tests + Integration Tests + env: + RETEST_IS_NECESSARY: ${{ steps.test-check.outputs.retest-is-needed}} + TRIGGERING_FILE: ${{ steps.test-check.outputs.triggering-file}} + run: | + if [[ $RETEST_IS_NECESSARY == "true" ]]; then + echo "Re-test was triggered!!, triggering changed file - $TRIGGERING_FILE" + echo "Running Again Unit-test =>" + npm run test + echo "Running Again Unit-test =>" + npm run integration-tests + else + echo "Re-test of library is not needed, continuing to deployment!" + fi + - name: Publish package env: NODE_AUTH_TOKEN: ${{ secrets.NPM_MAVEN_TOKEN }}