SK-3002 release/26.8.1 #1054
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
| name: PR CI Checks | |
| on: [pull_request] | |
| jobs: | |
| check-commit-message: | |
| name: Check Commit Message | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check JIRA ID | |
| uses: gsactions/commit-message-checker@v1 | |
| with: | |
| pattern: '(\[?[A-Z]{1,5}-[1-9][0-9]*)|(\[AUTOMATED\])|(Merge)|(Release).+$' | |
| flags: "gm" | |
| excludeDescription: "true" | |
| checkAllCommitMessages: "true" | |
| accessToken: ${{ secrets.PAT_ACTIONS }} | |
| error: "One of your your commit messages is not matching the format with JIRA ID Ex: ( SDK-123 commit message )" | |
| Test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v1 | |
| - uses: actions/setup-java@v1 | |
| with: | |
| java-version: "11" | |
| - name: create-json | |
| id: create-json | |
| uses: jsdaniell/create-json@1.1.2 | |
| with: | |
| name: "credentials.json" | |
| json: ${{ secrets.TEST_CREDENTIALS_FILE_STRING }} | |
| - name: create env | |
| id: create-env | |
| run: | | |
| touch .env | |
| echo SKYFLOW_CREDENTIALS=${{ secrets.SKYFLOW_CREDENTIALS }} >> .env | |
| echo TEST_EXPIRED_TOKEN=${{ secrets.TEST_EXPIRED_TOKEN }} >> .env | |
| echo TEST_REUSABLE_TOKEN=${{ secrets.TEST_REUSABLE_TOKEN }} >> .env | |
| - name: Distribute test fixtures to modules | |
| run: | | |
| # Surefire runs each module's tests with the module directory as the working | |
| # directory, so dotenv and ./credentials.json lookups miss the repo-root copies. | |
| for module in common skyvault flowvault; do | |
| cp .env "$module/.env" | |
| cp credentials.json "$module/credentials.json" | |
| done | |
| - name: Build & Run tests with Maven | |
| run: mvn -B package -f pom.xml -Dmaven.javadoc.skip=true | |
| # JaCoCo records packages as "com/skyflow/..." with no module prefix, and all three | |
| # modules share the com.skyflow package (deliberate split-package convention). So | |
| # "com/skyflow/config/VaultConfig.java" matches BOTH skyvault and flowvault, Codecov | |
| # resolves it to one of them, and the other module's file silently reports no data. | |
| # Prefixing each report with its own source root makes every path unique and match the | |
| # repo exactly, so all three modules' files are attributed correctly. | |
| - name: Qualify JaCoCo report paths with their module | |
| run: | | |
| for module in common skyvault flowvault; do | |
| report="$module/target/site/jacoco/jacoco.xml" | |
| if [ ! -f "$report" ]; then | |
| echo "Error: expected $report to exist after the build." | |
| exit 1 | |
| fi | |
| tmp="$(mktemp)" | |
| sed "s|<package name=\"|<package name=\"$module/src/main/java/|g" "$report" > "$tmp" | |
| mv "$tmp" "$report" | |
| done | |
| # One upload per module, each with its own flag, so Codecov reports per-module | |
| # coverage instead of merging three same-named package trees into one number. | |
| - name: Codecov (common) | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_REPO_UPLOAD_TOKEN }} | |
| files: common/target/site/jacoco/jacoco.xml | |
| flags: common | |
| name: codecov-common | |
| verbose: true | |
| fail_ci_if_error: true | |
| - name: Codecov (skyvault) | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_REPO_UPLOAD_TOKEN }} | |
| files: skyvault/target/site/jacoco/jacoco.xml | |
| flags: skyvault | |
| name: codecov-skyvault | |
| verbose: true | |
| fail_ci_if_error: true | |
| - name: Codecov (flowvault) | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_REPO_UPLOAD_TOKEN }} | |
| files: flowvault/target/site/jacoco/jacoco.xml | |
| flags: flowvault | |
| name: codecov-flowvault | |
| verbose: true | |
| fail_ci_if_error: true | |
| spellcheck: | |
| name: Run spellcheck | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: streetsidesoftware/cspell-action@v8 | |
| with: | |
| config: .cspell.json | |
| strict: true | |
| inline: error | |
| incremental_files_only: false |