GitHub Actions: install the api's dependencies before its tests; GHCR tags follow the GitLab registry
The api job ran npm test on a bare checkout. That was fine while the Coach tests needed nothing, but api/coach/node-fetch.js imports undici now, so the first run after the return to GitHub failed on ERR_MODULE_NOT_FOUND. Same install as test:api on GitLab. docker-publish used to put latest on every main push, and — because a release run also evaluated is_default_branch as true — on every release too; publishing thirteen releases at once left latest on whichever build finished last. Now a release publishes X.Y.Z, X.Y and latest, a main push publishes edge only, exactly like registry.gitlab.com.
This commit is contained in:
1 parent
53b46fde14
commit
265bbc83f5
2 files changed
+16
-3
No files matched your search
@@ -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}}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user