|
| 1 | +# Canary: builds this reference implementation against upstream |
| 2 | +# testcontainers-ory-hydra in a matrix of upstream targets and lint modes. |
| 3 | +# |
| 4 | +# Upstream targets: |
| 5 | +# - main: unreleased upstream, substituted via a Gradle composite |
| 6 | +# build (--include-build; matched by group:name, the pinned |
| 7 | +# version is ignored). Catches breaking changes before they |
| 8 | +# are released. |
| 9 | +# - latest-release: the newest published artifact from Maven Central, |
| 10 | +# selected via -PtestcontainersOryHydraVersion. Catches |
| 11 | +# drift between this app's pin and the latest release, and |
| 12 | +# exercises the artifact users actually consume. |
| 13 | +# |
| 14 | +# Lint modes: |
| 15 | +# - lenient red = that upstream target actually breaks this app: act now. |
| 16 | +# - strict red with lenient green = new deprecation warnings from upstream: |
| 17 | +# a migration heads-up, nothing is broken yet. |
| 18 | +# |
| 19 | +# Informational only — it does not gate merges. |
| 20 | +name: Upstream Canary |
| 21 | + |
| 22 | +on: |
| 23 | + workflow_dispatch: |
| 24 | + schedule: |
| 25 | + # Weekly, Monday 09:00 UTC. |
| 26 | + - cron: '0 9 * * 1' |
| 27 | + |
| 28 | +permissions: |
| 29 | + contents: read |
| 30 | + |
| 31 | +jobs: |
| 32 | + canary: |
| 33 | + name: canary (${{ matrix.upstream }}, ${{ matrix.lint }}) |
| 34 | + runs-on: ubuntu-latest |
| 35 | + strategy: |
| 36 | + fail-fast: false |
| 37 | + matrix: |
| 38 | + upstream: [main, latest-release] |
| 39 | + lint: [lenient, strict] |
| 40 | + steps: |
| 41 | + - uses: actions/checkout@v7 |
| 42 | + - name: Check out upstream testcontainers-ory-hydra (main) |
| 43 | + if: matrix.upstream == 'main' |
| 44 | + uses: actions/checkout@v7 |
| 45 | + with: |
| 46 | + repository: ardetrick/testcontainers-ory-hydra |
| 47 | + ref: main |
| 48 | + path: upstream-library |
| 49 | + - name: Resolve latest upstream release version |
| 50 | + if: matrix.upstream == 'latest-release' |
| 51 | + id: latest-release |
| 52 | + env: |
| 53 | + GH_TOKEN: ${{ github.token }} |
| 54 | + run: | |
| 55 | + TAG=$(gh api repos/ardetrick/testcontainers-ory-hydra/releases/latest --jq .tag_name) |
| 56 | + echo "Latest upstream release: $TAG" |
| 57 | + echo "version=${TAG#v}" >> "$GITHUB_OUTPUT" |
| 58 | + - name: Set up JDK 21 |
| 59 | + uses: actions/setup-java@v5 |
| 60 | + with: |
| 61 | + java-version: '21' |
| 62 | + distribution: 'temurin' |
| 63 | + cache: 'gradle' |
| 64 | + - name: Setup ms-playwright cache |
| 65 | + id: setup-ms-playwright-cache |
| 66 | + uses: actions/cache@v6 |
| 67 | + with: |
| 68 | + path: /home/runner/.cache/ms-playwright |
| 69 | + key: ms-playwright-cache-${{ runner.os }}-${{ hashFiles('reference-app/build.gradle.kts') }} |
| 70 | + - name: Install Playwright Dependencies |
| 71 | + if: steps.setup-ms-playwright-cache.outputs.cache-hit != 'true' |
| 72 | + run: | |
| 73 | + ./gradlew playwright --args="install-deps" --no-daemon |
| 74 | + ./gradlew playwright --args="install" --no-daemon |
| 75 | + - name: Build against upstream main |
| 76 | + if: matrix.upstream == 'main' |
| 77 | + env: |
| 78 | + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 |
| 79 | + run: > |
| 80 | + ./gradlew build |
| 81 | + ${{ matrix.lint == 'lenient' && '-PlenientLint=true' || '' }} |
| 82 | + --include-build upstream-library --no-daemon |
| 83 | + - name: Build against latest upstream release |
| 84 | + if: matrix.upstream == 'latest-release' |
| 85 | + env: |
| 86 | + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 |
| 87 | + run: > |
| 88 | + ./gradlew build |
| 89 | + ${{ matrix.lint == 'lenient' && '-PlenientLint=true' || '' }} |
| 90 | + -PtestcontainersOryHydraVersion=${{ steps.latest-release.outputs.version }} |
| 91 | + --no-daemon |
0 commit comments