Compare commits
2 commits
a1977e3efd
...
d6fe7ec3ff
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d6fe7ec3ff | ||
|
|
baa5ba4382 |
3 changed files with 15 additions and 5 deletions
|
|
@ -12,6 +12,7 @@ data
|
|||
.DS_Store
|
||||
npm-debug.log*
|
||||
Dockerfile
|
||||
Dockerfile.check
|
||||
.dockerignore
|
||||
docker-compose.yml
|
||||
extracted
|
||||
|
|
|
|||
|
|
@ -17,11 +17,9 @@ jobs:
|
|||
uses: actions/checkout@v4
|
||||
|
||||
- name: Lint and test
|
||||
# In the runner's own Docker, so this needs no extra actions. A failure
|
||||
# here stops the image being built, rather than deploying a broken one.
|
||||
run: |
|
||||
docker run --rm -v "$PWD":/src -w /src node:22-bookworm-slim \
|
||||
sh -c "npm ci --no-audit --no-fund && npm run lint && npm test"
|
||||
# Built, not mounted: this job runs in a container, so a host bind mount
|
||||
# of $PWD arrives empty. A failure here stops the image being built.
|
||||
run: docker build -f Dockerfile.check -t printhive-check .
|
||||
|
||||
- name: Log in to the Forgejo container registry
|
||||
# REGISTRY_TOKEN = a Forgejo access token with write:package scope, added
|
||||
|
|
|
|||
11
Dockerfile.check
Normal file
11
Dockerfile.check
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# Lint and tests, run in CI. A build context rather than a bind mount, because
|
||||
# the CI job runs inside a container of its own — $PWD there means nothing to
|
||||
# the Docker daemon, so a mounted folder arrives empty.
|
||||
FROM node:22-bookworm-slim
|
||||
WORKDIR /src
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci --no-audit --no-fund
|
||||
|
||||
COPY . .
|
||||
RUN npm run lint && npm test
|
||||
Loading…
Reference in a new issue