diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index ee9c60da13..c7ebd00a7e 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -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: diff --git a/.github/workflows/docker-edge.yml b/.github/workflows/docker-edge.yml index b4e8f0c6e4..2f0b29d82d 100644 --- a/.github/workflows/docker-edge.yml +++ b/.github/workflows/docker-edge.yml @@ -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 }} + + diff --git a/upcoming-release-notes/4952.md b/upcoming-release-notes/4952.md new file mode 100644 index 0000000000..cbbee76b3f --- /dev/null +++ b/upcoming-release-notes/4952.md @@ -0,0 +1,6 @@ +--- +category: Maintenance +authors: [rgoldfinger] +--- + +Add tests for the docker image build and the sync-server cli.