diff options
author | 2025-10-18 16:13:58 +0100 | |
---|---|---|
committer | 2025-10-18 19:24:06 +0100 | |
commit | 641ebbce828e8a32fdd4bb87a9a95d0c9368ee50 (patch) | |
tree | 11102fa924b3d0166a8d1f944ae49f626feada16 | |
parent | Update dependencies (diff) |
Build and use integration image for testing
-rw-r--r-- | .github/workflows/build.yaml | 26 | ||||
-rw-r--r-- | .github/workflows/test.yaml | 4 |
2 files changed, 23 insertions, 7 deletions
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7678669..d4e40ec 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -2,7 +2,7 @@ on: workflow_call: outputs: artifact: - description: The name of the uploaded image aretfact. + description: The name of the uploaded image artefact. value: ${{ jobs.build.outputs.artifact }} version: description: The package's version. @@ -10,13 +10,13 @@ on: jobs: build: - name: Build snekbox-venv image + name: Build snekbox-integration image runs-on: ubuntu-latest outputs: artifact: ${{ env.artifact }} version: ${{ steps.version.outputs.version }} env: - artifact: image_artifact_snekbox-venv + artifact: image_artifact_snekbox-integration steps: - name: Checkout code @@ -81,13 +81,29 @@ jobs: push: false target: venv build-args: DEV=1 - outputs: type=docker,dest=${{ env.artifact }}.tar cache-from: | ${{ steps.cache_config.outputs.cache_from }} ghcr.io/python-discord/snekbox-base:latest ghcr.io/python-discord/snekbox-venv:latest cache-to: ${{ steps.cache_config.outputs.cache_to }} - tags: ghcr.io/python-discord/snekbox-venv:${{ steps.version.outputs.version }} + tags: snekbox-venv:${{ steps.version.outputs.version }} + + - name: Build integration image for testing + uses: docker/build-push-action@v6 + with: + context: . + file: ./Dockerfile.pydis + push: false + pull: false + outputs: type=docker,dest=${{ env.artifact }}.tar + build-args: SNEKBOX_IMAGE=snekbox-venv + build-contexts: | + snekbox-venv=docker-image://snekbox-venv:${{ steps.version.outputs.version }} + cache-from: | + ${{ steps.cache_config.outputs.cache_from }} + ghcr.io/python-discord/snekbox-venv:latest + cache-to: ${{ steps.cache_config.outputs.cache_to }} + tags: ghcr.io/python-discord/snekbox-integration:${{ steps.version.outputs.version }} # Make the image available as an artifact so other jobs will be able to # download it. diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a7d66a1..74fffc0 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -34,7 +34,7 @@ jobs: - name: Run tests id: run_tests run: | - export IMAGE_SUFFIX='-venv:${{ inputs.version }}' + export IMAGE_SUFFIX='-integration:${{ inputs.version }}' docker compose run \ --rm -T -e COVERAGE_DATAFILE=.coverage \ --entrypoint coverage \ @@ -110,5 +110,5 @@ jobs: # This is to ensure that deployment won't fail at that step - name: Install eval deps run: | - export IMAGE_SUFFIX='-venv:${{ inputs.version }}' + export IMAGE_SUFFIX='-integration:${{ inputs.version }}' docker compose run --rm -T --entrypoint /bin/bash snekbox scripts/install_eval_deps.sh |