-
Notifications
You must be signed in to change notification settings - Fork 7
Add CI test pipeline, split unit/integration tests, and enforce tests in release workflows #10
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
63f4de9
Add CI pipeline, split unit/integration tests, and run tests before r…
junaiddshaukat 296fd31
feat: make TestConfig env-var configurable, add CI integration job, b…
junaiddshaukat 6d12066
fix: resolve failing integration tests and generate JWT via auth#signIn
junaiddshaukat 382b62b
ci: skip integration tests when secrets are unavailable (fork PRs)
junaiddshaukat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| unit-tests: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
|
|
||
| - name: Setup Gradle | ||
| uses: gradle/actions/setup-gradle@v3 | ||
|
|
||
| - name: Build and run unit tests | ||
| run: ./gradlew build test | ||
|
|
||
| integration-tests: | ||
| runs-on: ubuntu-latest | ||
| needs: unit-tests | ||
|
|
||
| steps: | ||
| - name: Check for required secrets | ||
| id: check-secrets | ||
| run: | | ||
| if [ -z "${{ secrets.INSFORGE_BASE_URL }}" ]; then | ||
| echo "available=false" >> "$GITHUB_OUTPUT" | ||
| echo "Secrets not available — skipping integration tests (fork PR)" | ||
| else | ||
| echo "available=true" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: Checkout repository | ||
| if: steps.check-secrets.outputs.available == 'true' | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up JDK 17 | ||
| if: steps.check-secrets.outputs.available == 'true' | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
|
|
||
| - name: Setup Gradle | ||
| if: steps.check-secrets.outputs.available == 'true' | ||
| uses: gradle/actions/setup-gradle@v3 | ||
|
|
||
| - name: Run integration tests | ||
| if: steps.check-secrets.outputs.available == 'true' | ||
| run: ./gradlew integrationTest | ||
| env: | ||
| INSFORGE_BASE_URL: ${{ secrets.INSFORGE_BASE_URL }} | ||
| INSFORGE_ANON_KEY: ${{ secrets.INSFORGE_ANON_KEY }} | ||
| INSFORGE_TEST_EMAIL: ${{ secrets.INSFORGE_TEST_EMAIL }} | ||
| INSFORGE_TEST_PASSWORD: ${{ secrets.INSFORGE_TEST_PASSWORD }} | ||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is indeed the case that secrets are unavailable for PRs originating from forks. Consequently, the current job still executes, passing empty strings to the integration tests.
Could you modify the workflow to first check for the presence of secrets; if they are missing, the integration tests will be skipped entirely to prevent fork PRs from failing due to missing configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
working on it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed now, please have a look