diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index ec6db7d..6ebcb67 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -4,6 +4,12 @@ name: Publish Docker images # A tag that is later deleted (the versioning rule consolidates unreleased tags) # would otherwise leave its image tags behind in GHCR forever, and dependency # bots read those as a newer version. See issue #87. +# +# Tags follow the GitLab registry so both say the same thing: a release publishes +# `X.Y.Z`, `X.Y` and `latest`; a push to main publishes only `edge`. (`latest` used +# to follow main here, and a release run overwrote it as well, so thirteen releases +# published at once left it pointing at whichever finished last.) Re-running the +# workflow by hand on a `vX.Y.Z` ref republishes exactly that version's tags. on: push: branches: [main] @@ -61,7 +67,8 @@ jobs: with: images: ghcr.io/${{ steps.repo.outputs.owner }}/opengym-${{ matrix.image }} tags: | - type=raw,value=latest,enable={{is_default_branch}} + type=raw,value=edge,enable=${{ github.ref == 'refs/heads/main' }} + type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') }} type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 986105c..12ccd68 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -89,8 +89,14 @@ jobs: - uses: actions/setup-node@v7 with: node-version: 22 - # Nothing to install: the Coach tests run on node:test and drive the in-repo fixture - # provider, so the whole job works without an AI account, a network, or a dependency. + cache: npm + cache-dependency-path: api/package-lock.json + # The Coach tests run on node:test and drive the in-repo fixture provider plus a local mock + # of the Chat Completions shape, so the job needs no AI account and no network — but it does + # need the api's own dependencies since the server-side fetch moved onto undici (same + # install as test:api in .gitlab-ci.yml; the Agent SDK is optional and stays out). + - run: npm ci --omit=optional + working-directory: api - run: npm test working-directory: api # The api's copy of the exercise catalogue is generated and committed. A dataset change