1414 - develop
1515
1616env :
17- VERSION_NUMBER : " 1.0.6 "
17+ VERSION_NUMBER : " 1.0.7 "
1818 LATEST_PYTHON_VERSION : " 3.14"
1919 LATEST_SC2_VERSION : " 4.10"
2020 EXPERIMENTAL_PYTHON_VERSION : " 3.15"
2121
2222jobs :
23+ download_sc2_maps :
24+ name : Download and cache sc2 maps
25+ runs-on : ${{ matrix.os }}
26+ timeout-minutes : 15
27+ strategy :
28+ fail-fast : false
29+ matrix :
30+ os : [ubuntu-latest]
31+
32+ steps :
33+ - uses : actions/checkout@v3
34+
35+ - name : Cache sc2 maps
36+ uses : actions/cache@v4
37+ id : cache-sc2-maps
38+ with :
39+ path : |
40+ dockerfiles/maps
41+ key : ${{ runner.os }}-maps-${{ hashFiles('dockerfiles/maps/**') }}
42+ restore-keys : |
43+ ${{ runner.os }}-maps-
44+
45+ - name : Download sc2 maps
46+ run : sh dockerfiles/download_maps.sh
47+ if : steps.cache-sc2-maps.outputs.cache-hit != 'true'
48+
2349 run_test_docker_image :
2450 name : Run test_docker_image.sh
51+ needs : [download_sc2_maps]
2552 runs-on : ${{ matrix.os }}
2653 timeout-minutes : 30
2754 strategy :
3259 steps :
3360 - uses : actions/checkout@v3
3461
62+ - name : Cache sc2 maps
63+ uses : actions/cache@v4
64+ id : cache-sc2-maps
65+ with :
66+ path : |
67+ dockerfiles/maps
68+ key : ${{ runner.os }}-maps-${{ hashFiles('dockerfiles/maps/**') }}
69+ restore-keys : |
70+ ${{ runner.os }}-maps-
71+
72+ - name : Download sc2 maps
73+ run : sh dockerfiles/download_maps.sh
74+ if : steps.cache-sc2-maps.outputs.cache-hit != 'true'
75+
3576 - name : Enable experimental docker features
3677 run : |
3778 echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
4687
4788 run_test_new_python_version :
4889 name : Run test_new_python_candidate.sh
90+ needs : [download_sc2_maps]
4991 runs-on : ${{ matrix.os }}
5092 timeout-minutes : 30
5193 strategy :
5698 steps :
5799 - uses : actions/checkout@v3
58100
101+ - name : Cache sc2 maps
102+ uses : actions/cache@v4
103+ id : cache-sc2-maps
104+ with :
105+ path : |
106+ dockerfiles/maps
107+ key : ${{ runner.os }}-maps-${{ hashFiles('dockerfiles/maps/**') }}
108+ restore-keys : |
109+ ${{ runner.os }}-maps-
110+
111+ - name : Download sc2 maps
112+ run : sh dockerfiles/download_maps.sh
113+ if : steps.cache-sc2-maps.outputs.cache-hit != 'true'
114+
59115 - name : Enable experimental docker features
60116 run : |
61117 echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
71127
72128 docker_build :
73129 name : Build docker image
130+ needs : [download_sc2_maps]
74131 runs-on : ${{ matrix.os }}
75132 timeout-minutes : 30
76133 strategy :
@@ -86,26 +143,31 @@ jobs:
86143 steps :
87144 - uses : actions/checkout@v3
88145
89- - name : Build docker image
90- run : docker build -t $IMAGE_NAME-v$VERSION_NUMBER $BUILD_ARGS - < dockerfiles/Dockerfile
146+ - name : Cache sc2 maps
147+ uses : actions/cache@v4
148+ id : cache-sc2-maps
149+ with :
150+ path : |
151+ dockerfiles/maps
152+ key : ${{ runner.os }}-maps-${{ hashFiles('dockerfiles/maps/**') }}
153+ restore-keys : |
154+ ${{ runner.os }}-maps-
91155
92- - name : Enable experimental docker features
93- run : |
94- echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
95- sudo systemctl restart docker.service
156+ - name : Download sc2 maps
157+ run : sh dockerfiles/download_maps.sh
158+ if : steps.cache-sc2-maps.outputs.cache-hit != 'true'
96159
97- - name : Build squashed image
98- run : docker build -t $IMAGE_NAME-v$VERSION_NUMBER-squashed --squash $BUILD_ARGS - < dockerfiles/Dockerfile
160+ - name : Build docker image
161+ run : docker build -f dockerfiles/Dockerfile - t $IMAGE_NAME-v$VERSION_NUMBER $BUILD_ARGS .
99162
100- - name : Run test bots on squashed image
101- if : matrix.python-version != '3.7'
163+ - name : Run test bots on image
102164 run : |
103165 echo "Start container, override the default entrypoint"
104166 docker run -i -d \
105167 --name test_container \
106168 --env 'PYTHONPATH=/root/python-sc2/' \
107169 --entrypoint /bin/bash \
108- $IMAGE_NAME-v$VERSION_NUMBER-squashed
170+ $IMAGE_NAME-v$VERSION_NUMBER
109171 echo "Install python-sc2"
110172 docker exec -i test_container mkdir -p /root/python-sc2
111173 docker cp pyproject.toml test_container:/root/python-sc2/
@@ -131,12 +193,8 @@ jobs:
131193 if : github.ref == 'refs/heads/develop' && github.event_name == 'push'
132194 run : docker push $IMAGE_NAME-v$VERSION_NUMBER
133195
134- - name : Upload squashed docker image
135- if : github.ref == 'refs/heads/develop' && github.event_name == 'push'
136- run : docker push $IMAGE_NAME-v$VERSION_NUMBER-squashed
137-
138- - name : Upload squashed docker image as latest tag
196+ - name : Upload docker image as latest tag
139197 if : github.ref == 'refs/heads/develop' && github.event_name == 'push' && matrix.python-version == env.LATEST_PYTHON_VERSION && matrix.sc2-version == env.LATEST_SC2_VERSION
140198 run : |
141- docker tag $IMAGE_NAME-v$VERSION_NUMBER-squashed burnysc2/python-sc2-docker:latest
199+ docker tag $IMAGE_NAME-v$VERSION_NUMBER burnysc2/python-sc2-docker:latest
142200 docker push burnysc2/python-sc2-docker:latest
0 commit comments