Skip to content

Commit a93e4e2

Browse files
committed
Build and use integration image for testing
1 parent ba6826e commit a93e4e2

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

.github/workflows/build.yaml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ on:
22
workflow_call:
33
outputs:
44
artifact:
5-
description: The name of the uploaded image aretfact.
5+
description: The name of the uploaded image artefact.
66
value: ${{ jobs.build.outputs.artifact }}
77
version:
88
description: The package's version.
99
value: ${{ jobs.build.outputs.version }}
1010

1111
jobs:
1212
build:
13-
name: Build snekbox-venv image
13+
name: Build snekbox-integration image
1414
runs-on: ubuntu-latest
1515
outputs:
1616
artifact: ${{ env.artifact }}
1717
version: ${{ steps.version.outputs.version }}
1818
env:
19-
artifact: image_artifact_snekbox-venv
19+
artifact: image_artifact_snekbox-integration
2020

2121
steps:
2222
- name: Checkout code
@@ -81,13 +81,29 @@ jobs:
8181
push: false
8282
target: venv
8383
build-args: DEV=1
84-
outputs: type=docker,dest=${{ env.artifact }}.tar
8584
cache-from: |
8685
${{ steps.cache_config.outputs.cache_from }}
8786
ghcr.io/python-discord/snekbox-base:latest
8887
ghcr.io/python-discord/snekbox-venv:latest
8988
cache-to: ${{ steps.cache_config.outputs.cache_to }}
90-
tags: ghcr.io/python-discord/snekbox-venv:${{ steps.version.outputs.version }}
89+
tags: snekbox-venv:${{ steps.version.outputs.version }}
90+
91+
- name: Build integration image for testing
92+
uses: docker/build-push-action@v6
93+
with:
94+
context: .
95+
file: ./Dockerfile.pydis
96+
push: false
97+
pull: false
98+
outputs: type=docker,dest=${{ env.artifact }}.tar
99+
build-args: SNEKBOX_IMAGE=snekbox-venv
100+
build-contexts: |
101+
snekbox-venv=docker-image://snekbox-venv:${{ steps.version.outputs.version }}
102+
cache-from: |
103+
${{ steps.cache_config.outputs.cache_from }}
104+
ghcr.io/python-discord/snekbox-venv:latest
105+
cache-to: ${{ steps.cache_config.outputs.cache_to }}
106+
tags: ghcr.io/python-discord/snekbox-integration:${{ steps.version.outputs.version }}
91107

92108
# Make the image available as an artifact so other jobs will be able to
93109
# download it.

.github/workflows/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Run tests
3535
id: run_tests
3636
run: |
37-
export IMAGE_SUFFIX='-venv:${{ inputs.version }}'
37+
export IMAGE_SUFFIX='-integration:${{ inputs.version }}'
3838
docker compose run \
3939
--rm -T -e COVERAGE_DATAFILE=.coverage \
4040
--entrypoint coverage \
@@ -110,5 +110,5 @@ jobs:
110110
# This is to ensure that deployment won't fail at that step
111111
- name: Install eval deps
112112
run: |
113-
export IMAGE_SUFFIX='-venv:${{ inputs.version }}'
113+
export IMAGE_SUFFIX='-integration:${{ inputs.version }}'
114114
docker compose run --rm -T --entrypoint /bin/bash snekbox scripts/install_eval_deps.sh

0 commit comments

Comments
 (0)