Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add re-test functionality to staging workflow #134

Merged
merged 1 commit into from
May 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
paths:
- "generated/**"
- "src/**"
- "test/**"
- "package-lock.json"
- "package.json"
- "tsconfig.json"
Expand All @@ -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 }}"
Expand All @@ -60,6 +86,29 @@ jobs:
- name: Compile project
run: npm run compile

- name: Check if re-test is needed
id: test-check
uses: zvigrinberg/[email protected]
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 }}
Expand Down
Loading