The tests pass on the runner. But the runner isn't what ships: the image is, and it holds only what the Dockerfile copies into it. Test the image itself:
- run: docker build -t registry.monster.market/shop:${{ github.sha }} .
- run: docker run --rm registry.monster.market/shop:${{ github.sha }} ./test.shdocker run --rm <image> ./test.sh runs the tests in a container made from the image, then removes the container. A failing test exits non-zero, so the step fails, and the job with it.
Each job has its own machine, so the image exists only in the job that built it: test it in that job, right after the build.
Objectives
- Test inside the image.
- Which file is the image missing?
- Ship what passes.