|
| 1 | +name: PR CI Checks (flowvault) |
| 2 | + |
| 3 | +# flowvault is a folder under main, alongside v2 and v3 - not a branch. |
| 4 | +# This workflow fires for PRs targeting main or a flowvault-release/* branch |
| 5 | +# that actually touch flowvault or its common dependency, and only builds/tests |
| 6 | +# those two modules. v3 keeps its own CI in pr.yml; v2 is untouched here. |
| 7 | + |
| 8 | +on: |
| 9 | + pull_request: |
| 10 | + branches: [ "main", "flowvault-release/**" ] |
| 11 | + paths: |
| 12 | + - "flowvault/**" |
| 13 | + - "common/**" |
| 14 | + - "pom.xml" |
| 15 | + |
| 16 | +jobs: |
| 17 | + build: |
| 18 | + name: Build |
| 19 | + runs-on: ubuntu-latest |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v4 |
| 22 | + |
| 23 | + - uses: actions/setup-java@v4 |
| 24 | + with: |
| 25 | + distribution: "temurin" |
| 26 | + java-version: "11" |
| 27 | + cache: "maven" |
| 28 | + |
| 29 | + # package (not verify/install) deliberately stops short of any japicmp |
| 30 | + # contract gate bound to a module's `verify` phase - that's a separate |
| 31 | + # check. This job only proves flowvault (and common) compile and package. |
| 32 | + - name: Build flowvault |
| 33 | + run: | |
| 34 | + mvn -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ |
| 35 | + clean package -pl flowvault -am -DskipTests -Dmaven.javadoc.skip=true -Dgpg.skip=true |
| 36 | +
|
| 37 | + test: |
| 38 | + name: Unit Tests |
| 39 | + runs-on: ubuntu-latest |
| 40 | + steps: |
| 41 | + - uses: actions/checkout@v4 |
| 42 | + |
| 43 | + - uses: actions/setup-java@v4 |
| 44 | + with: |
| 45 | + distribution: "temurin" |
| 46 | + java-version: "11" |
| 47 | + cache: "maven" |
| 48 | + |
| 49 | + - name: create-json |
| 50 | + id: create-json |
| 51 | + uses: jsdaniell/create-json@1.1.2 |
| 52 | + with: |
| 53 | + name: "credentials.json" |
| 54 | + json: ${{ secrets.TEST_CREDENTIALS_FILE_STRING }} |
| 55 | + |
| 56 | + - name: create env |
| 57 | + id: create-env |
| 58 | + run: | |
| 59 | + for dir in common flowvault; do |
| 60 | + if [ -f "$dir/pom.xml" ]; then |
| 61 | + cp credentials.json "$dir/credentials.json" |
| 62 | + { |
| 63 | + echo "SKYFLOW_CREDENTIALS=${{ secrets.SKYFLOW_CREDENTIALS }}" |
| 64 | + echo "TEST_EXPIRED_TOKEN=${{ secrets.TEST_EXPIRED_TOKEN }}" |
| 65 | + echo "TEST_REUSABLE_TOKEN=${{ secrets.TEST_REUSABLE_TOKEN }}" |
| 66 | + } >> "$dir/.env" |
| 67 | + fi |
| 68 | + done |
| 69 | +
|
| 70 | + # jacoco:report is already bound to the `test` phase in the root pom |
| 71 | + # (prepare-agent + report executions), so `mvn test` alone regenerates |
| 72 | + # coverage - no need to invoke jacoco:report again on the command line. |
| 73 | + - name: Run flowvault unit tests |
| 74 | + run: | |
| 75 | + mvn -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ |
| 76 | + clean test -pl flowvault -am -Dmaven.javadoc.skip=true -Dgpg.skip=true |
| 77 | +
|
| 78 | + - name: Codecov |
| 79 | + uses: codecov/codecov-action@v5 |
| 80 | + with: |
| 81 | + token: ${{ secrets.CODECOV_REPO_UPLOAD_TOKEN }} |
| 82 | + files: flowvault/target/site/jacoco/jacoco.xml |
| 83 | + flags: unittests-flowvault |
| 84 | + name: codecov-skyflow-java-flowvault |
| 85 | + fail_ci_if_error: true |
| 86 | + verbose: true |
0 commit comments