Add test that docker images are working (#4952)

* use build directory in dockerfiles

* add release notes

* add test

* Add test for cli, try to fix image test

* - fail

* try again

* try again to fail

* done testing

* Code review

* publish is unecessary
This commit is contained in:
Roger Goldfinger
2025-06-05 07:31:56 -07:00
committed by GitHub
parent cac318255d
commit cd15aded05
3 changed files with 36 additions and 1 deletions

View File

@@ -27,6 +27,16 @@ jobs:
uses: ./.github/actions/setup
- name: Typecheck
run: yarn typecheck
validate-cli:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up environment
uses: ./.github/actions/setup
- name: Build Web
run: yarn build:server
- name: Check that the built CLI works
run: node packages/sync-server/build/bin/actual-server.js --version
test:
runs-on: ubuntu-latest
steps:

View File

@@ -80,7 +80,24 @@ jobs:
- name: Build Web
run: yarn build:server
- name: Build and push image
- name: Build image for testing
uses: docker/build-push-action@v5
with:
context: .
load: true
file: packages/sync-server/docker/${{ matrix.os }}.Dockerfile
tags: actual-test=${{ matrix.os }}
build-args: |
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
- name: Test that the docker image boots
run: |
docker run --detach --network=host actual-test-${{ matrix.os }}
sleep 5
curl --fail -sS -LI -w '%{http_code}\n' --retry 10 --retry-delay 1 --retry-connrefused localhost:5006
# This will use the cache from the earlier build step and not rebuild the image
# https://docs.docker.com/build/ci/github-actions/test-before-push/
- name: Build and push images
uses: docker/build-push-action@v5
with:
context: .
@@ -90,3 +107,5 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
build-args: |
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}

View File

@@ -0,0 +1,6 @@
---
category: Maintenance
authors: [rgoldfinger]
---
Add tests for the docker image build and the sync-server cli.