1414 - develop
1515
1616env :
17- VERSION_NUMBER : " 1.0.6 "
18- LATEST_PYTHON_VERSION : " 3.13 "
17+ VERSION_NUMBER : " 1.0.7 "
18+ LATEST_PYTHON_VERSION : " 3.14 "
1919 LATEST_SC2_VERSION : " 4.10"
20- EXPERIMENTAL_PYTHON_VERSION : " 3.14 "
20+ 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 :
@@ -32,10 +59,19 @@ jobs:
3259 steps :
3360 - uses : actions/checkout@v3
3461
35- - name : Enable experimental docker features
36- run : |
37- echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
38- sudo systemctl restart docker.service
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'
3975
4076 - name : Run shell script
4177 env :
4682
4783 run_test_new_python_version :
4884 name : Run test_new_python_candidate.sh
85+ needs : [download_sc2_maps]
4986 runs-on : ${{ matrix.os }}
5087 timeout-minutes : 30
5188 strategy :
@@ -56,10 +93,19 @@ jobs:
5693 steps :
5794 - uses : actions/checkout@v3
5895
59- - name : Enable experimental docker features
60- run : |
61- echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
62- sudo systemctl restart docker.service
96+ - name : Cache sc2 maps
97+ uses : actions/cache@v4
98+ id : cache-sc2-maps
99+ with :
100+ path : |
101+ dockerfiles/maps
102+ key : ${{ runner.os }}-maps-${{ hashFiles('dockerfiles/maps/**') }}
103+ restore-keys : |
104+ ${{ runner.os }}-maps-
105+
106+ - name : Download sc2 maps
107+ run : sh dockerfiles/download_maps.sh
108+ if : steps.cache-sc2-maps.outputs.cache-hit != 'true'
63109
64110 - name : Run shell script
65111 continue-on-error : true
@@ -71,13 +117,14 @@ jobs:
71117
72118 docker_build :
73119 name : Build docker image
120+ needs : [download_sc2_maps]
74121 runs-on : ${{ matrix.os }}
75122 timeout-minutes : 30
76123 strategy :
77124 fail-fast : false
78125 matrix :
79126 os : [ubuntu-latest]
80- python-version : ["3.9", "3.10", "3.11", "3.12", "3.13"]
127+ python-version : ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14" ]
81128 sc2-version : ["4.10"]
82129 env :
83130 IMAGE_NAME : burnysc2/python-sc2-docker:py_${{ matrix.python-version }}-sc2_${{ matrix.sc2-version }}
@@ -86,26 +133,31 @@ jobs:
86133 steps :
87134 - uses : actions/checkout@v3
88135
89- - name : Build docker image
90- run : docker build -t $IMAGE_NAME-v$VERSION_NUMBER $BUILD_ARGS - < dockerfiles/Dockerfile
136+ - name : Cache sc2 maps
137+ uses : actions/cache@v4
138+ id : cache-sc2-maps
139+ with :
140+ path : |
141+ dockerfiles/maps
142+ key : ${{ runner.os }}-maps-${{ hashFiles('dockerfiles/maps/**') }}
143+ restore-keys : |
144+ ${{ runner.os }}-maps-
91145
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
146+ - name : Download sc2 maps
147+ run : sh dockerfiles/download_maps.sh
148+ if : steps.cache-sc2-maps.outputs.cache-hit != 'true'
96149
97- - name : Build squashed image
98- run : docker build -t $IMAGE_NAME-v$VERSION_NUMBER-squashed --squash $BUILD_ARGS - < dockerfiles/Dockerfile
150+ - name : Build docker image
151+ run : docker build -f dockerfiles/Dockerfile - t $IMAGE_NAME-v$VERSION_NUMBER $BUILD_ARGS .
99152
100- - name : Run test bots on squashed image
101- if : matrix.python-version != '3.7'
153+ - name : Run test bots on image
102154 run : |
103155 echo "Start container, override the default entrypoint"
104156 docker run -i -d \
105157 --name test_container \
106158 --env 'PYTHONPATH=/root/python-sc2/' \
107159 --entrypoint /bin/bash \
108- $IMAGE_NAME-v$VERSION_NUMBER-squashed
160+ $IMAGE_NAME-v$VERSION_NUMBER
109161 echo "Install python-sc2"
110162 docker exec -i test_container mkdir -p /root/python-sc2
111163 docker cp pyproject.toml test_container:/root/python-sc2/
@@ -131,12 +183,8 @@ jobs:
131183 if : github.ref == 'refs/heads/develop' && github.event_name == 'push'
132184 run : docker push $IMAGE_NAME-v$VERSION_NUMBER
133185
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
186+ - name : Upload docker image as latest tag
139187 if : github.ref == 'refs/heads/develop' && github.event_name == 'push' && matrix.python-version == env.LATEST_PYTHON_VERSION && matrix.sc2-version == env.LATEST_SC2_VERSION
140188 run : |
141- docker tag $IMAGE_NAME-v$VERSION_NUMBER-squashed burnysc2/python-sc2-docker:latest
189+ docker tag $IMAGE_NAME-v$VERSION_NUMBER burnysc2/python-sc2-docker:latest
142190 docker push burnysc2/python-sc2-docker:latest
0 commit comments