feat(provider-tck): add Java conformance suite for OpenFeature providers #10131
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: CI | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| branches: | |
| - main | |
| # Temporary, for the duration of the provider conformance suite's review. | |
| # Without it a stacked pull request gets no CI at all: this filter matches | |
| # the pull request's BASE branch, so only the suite PR itself -- the one | |
| # targeting main -- was ever checked, and the report and adoption PRs | |
| # stacked on it were merged-in-theory and tested never. Remove once the | |
| # chain has landed. See open-feature/spec#417. | |
| - 'feat/provider-tck*' | |
| jobs: | |
| # Fast canary for the Provider TCK: runs the full applicable conformance suite three times -- | |
| # against the SDK's InMemoryProvider, against MultiProvider wrapping one of them, and against | |
| # the TCK's own controllable provider, which has a real initialisation and so is the only one | |
| # of the three that covers the @lifecycle scenarios. No Docker, no Compose stack and no | |
| # network. It finishes in seconds, so a broken step definition, a mis-wired capability gate or | |
| # a regression in the shared harness is reported long before the containerised provider suites | |
| # in `main` get there — and it points at the TCK rather than at whichever provider noticed | |
| # first. | |
| # | |
| # Deliberately not a gate on `main`: the two run in parallel so a green run is not delayed. | |
| # The same suite also runs inside `main` as part of the reactor build; this job exists to | |
| # report it fast and in isolation. | |
| tck: | |
| name: Provider TCK (no Docker) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| with: | |
| # The feature files, canonical flag set and control-API document are copied in from | |
| # the open-feature/spec submodule at generate-resources; without it there is no suite. | |
| submodules: recursive | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5 | |
| with: | |
| java-version: 21 | |
| distribution: 'temurin' | |
| cache: maven | |
| - name: Cache local Maven repository | |
| uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}21-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}21-maven- | |
| - name: Verify the TCK against the in-memory provider | |
| # No `e2e` profile and no Docker: the in-memory suite is not gated behind either. | |
| run: mvn --batch-mode --activate-profiles codequality -pl tools/tck -am clean verify | |
| main: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] | |
| build: | |
| - java: 21 | |
| # deploy profile is included to catch javadoc/SBOM/source-jar issues at PR time | |
| # note this is the publish PROFILE, not PHASE | |
| profile: codequality,deploy | |
| - java: 11 | |
| profile: java11 | |
| name: with Java ${{ matrix.build.java }} | |
| runs-on: ${{ matrix.os}} | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| with: | |
| submodules: recursive | |
| - name: Set up JDK ${{ matrix.build.java }} | |
| uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5 | |
| with: | |
| java-version: ${{ matrix.build.java }} | |
| distribution: 'temurin' | |
| cache: maven | |
| - name: Cache local Maven repository | |
| uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}${{ matrix.build.java }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}${{ matrix.build.java }}-maven- | |
| - name: Maven Verify | |
| # Run Maven build with e2e and specific profile, using parallel threads (if some provider decides to use a different toolchain version, this might break) | |
| run: mvn -T 2C --batch-mode --activate-profiles e2e,${{ matrix.build.profile }} clean verify |