Skip to content

Commit 15b5763

Browse files
committed
Skip 'Login to DockerHub' in PRs, add 'VERSION_NUMBER' as build arg, use 'squashed' docker image to run tests
1 parent ccef791 commit 15b5763

3 files changed

Lines changed: 13 additions & 14 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ jobs:
215215
# Build docker image from Dockerfile using specific python and sc2 version
216216
env:
217217
BUILD_ARGS: --build-arg PYTHON_VERSION=${{ matrix.python-version }} --build-arg SC2_VERSION=${{ matrix.sc2-version }}
218-
run: docker build -f test/Dockerfile -t $IMAGE_NAME $BUILD_ARGS .
218+
run: docker build -f test/Dockerfile -t $IMAGE_NAME $BUILD_ARGS --build-arg VERSION_NUMBER=${{ env.VERSION_NUMBER }} .
219219

220220
- name: Run autotest_bot.py
221221
# Run bot and list resulting files (replay file, stable_id.json)
@@ -279,15 +279,11 @@ jobs:
279279
# run_bot_vs_bot:
280280
# # Run bot vs bot
281281
# name: Run example bots against each other
282-
# runs-on: ${{ matrix.os }}
283-
# timeout-minutes: 30
284-
# strategy:
285-
# # Do not allow this test to cancel. Finish all jobs regardless of error
286-
# fail-fast: false
287-
# matrix:
288-
# os: [ubuntu-latest]
289-
# python-version: ['3.10']
290-
# sc2-version: ['4.10']
282+
# needs: [run_pytest_tests]
283+
# timeout-minutes: 60
284+
# env:
285+
# IMAGE_NAME: burnysc2/python-sc2-docker:local
286+
#
291287
# steps:
292288
# # Copy data from repository
293289
# - uses: actions/checkout@v3
@@ -298,13 +294,15 @@ jobs:
298294
# tree
299295
#
300296
# - name: Load and build docker image
301-
# # Build docker image from Dockerfile using python 3.8
297+
# # Build docker image from Dockerfile using specific python and sc2 version
298+
# env:
299+
# BUILD_ARGS: --build-arg PYTHON_VERSION=${{ env.LATEST_PYTHON_VERSION }} --build-arg SC2_VERSION=${{ env.LATEST_SC2_VERSION }}
302300
# run: |
303-
# docker build -t test_image -f test/Dockerfile --build-arg PYTHON_VERSION=${{ matrix.python-version }} --build-arg SC2_VERSION=${{ matrix.sc2-version }} --build-arg VERSION_NUMBER=$VERSION_NUMBER .
301+
# docker build -f test/Dockerfile -t $IMAGE_NAME $BUILD_ARGS --build-arg VERSION_NUMBER=${{ env.VERSION_NUMBER }} .
304302
#
305303
# - name: Run example bots vs each other
306304
# run: |
307-
# docker run -it -d --name my_container test_image
305+
# docker run -i -d --name my_container $IMAGE_NAME
308306
# docker exec -i my_container bash -c "python test/run_example_bots_vs_each_other.py"
309307
# docker exec -i my_container bash -c "tree"
310308
# docker rm -f my_container

.github/workflows/docker-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ jobs:
112112
docker exec -i test_container bash -c "cd python-sc2 && poetry run python test/run_example_bots_vs_computer.py"
113113
114114
- name: Login to DockerHub
115+
if: github.ref == 'refs/heads/develop'
115116
uses: docker/login-action@v2
116117
with:
117118
username: ${{ secrets.DOCKERHUB_USERNAME }}

test/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ARG PYTHON_VERSION=3.8
66
ARG SC2_VERSION=4.10
77
ARG VERSION_NUMBER=1.0.0
88

9-
FROM burnysc2/python-sc2-docker:py_$PYTHON_VERSION-sc2_$SC2_VERSION-v$VERSION_NUMBER
9+
FROM burnysc2/python-sc2-docker:py_$PYTHON_VERSION-sc2_$SC2_VERSION-v$VERSION_NUMBER-squashed
1010

1111
# Debugging purposes
1212
RUN echo $PYTHON_VERSION

0 commit comments

Comments
 (0)