Skip to content

Commit dfb9a0b

Browse files
committed
fix: Test the current Windows Dockerfile, not an old Dockerhub image
A bit infuriating that when you submit a PR modifying the Windows cross-compilation script, the CI *builds* the current image in one job, but then *runs* an older (!) image from Dockerhub in another. So it tests that the modified image builds successfully but doesn't test if it runs successfully, instead testing if an older image runs successfully / testing if the current toxcore changes run successfully in an older image. This should build and run the same image with the current changes.
1 parent 14de93c commit dfb9a0b

File tree

3 files changed

+24
-40
lines changed

3 files changed

+24
-40
lines changed

.github/scripts/cmake-windows.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ docker run \
2626
-v "$PWD:/toxcore" \
2727
-v "$PWD/result:/prefix" \
2828
--rm \
29+
-t \
30+
--pull never \
2931
"toxchat/windows:$WINDOWS_ARCH"

.github/workflows/ci.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
- name: Build and test
8484
run: .github/scripts/cmake-osx
8585

86-
build-msvc:
86+
build-windows-msvc:
8787
strategy:
8888
matrix:
8989
version: [2019, 2022]
@@ -110,18 +110,6 @@ jobs:
110110
cd _build
111111
ctest -j50 --output-on-failure --rerun-failed --repeat until-pass:6 --build-config Debug
112112
113-
build-windows:
114-
strategy:
115-
matrix:
116-
bits: [32, 64]
117-
runs-on: ubuntu-latest
118-
steps:
119-
- uses: actions/checkout@v4
120-
with:
121-
submodules: recursive
122-
- name: Cross compilation
123-
run: .github/scripts/cmake-win${{ matrix.bits }} script
124-
125113
build-netbsd:
126114
runs-on: ubuntu-latest
127115
steps:

.github/workflows/docker.yml

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,15 @@ jobs:
138138
cache-from: type=registry,ref=toxchat/c-toxcore:esp32
139139
cache-to: type=inline
140140

141-
docker-win32:
141+
docker-windows-mingw:
142+
strategy:
143+
matrix:
144+
bits: [32, 64]
142145
runs-on: ubuntu-latest
143146
steps:
147+
- uses: actions/checkout@v4
148+
with:
149+
submodules: recursive
144150
- name: Set up Docker Buildx
145151
uses: docker/setup-buildx-action@v3
146152
- name: Login to DockerHub
@@ -149,39 +155,27 @@ jobs:
149155
with:
150156
username: ${{ secrets.DOCKERHUB_USERNAME }}
151157
password: ${{ secrets.DOCKERHUB_TOKEN }}
152-
- name: Build and push
158+
- name: Build and store to local Docker daemon
153159
uses: docker/build-push-action@v5
154160
with:
155-
context: "{{defaultContext}}:other/docker/windows"
156-
push: ${{ github.event_name == 'push' }}
157-
tags: toxchat/windows:win32
158-
cache-from: type=registry,ref=toxchat/windows:win32
159-
cache-to: type=inline
161+
context: other/docker/windows
162+
load: true
163+
tags: toxchat/windows:win${{ matrix.bits }}
164+
cache-from: type=registry,ref=toxchat/windows:win${{ matrix.bits }}
160165
build-args: |
161-
SUPPORT_ARCH_i686=true
162-
SUPPORT_ARCH_x86_64=false
166+
SUPPORT_ARCH_i686=${{ matrix.bits == '32' }}
167+
SUPPORT_ARCH_x86_64=${{ matrix.bits == '64' }}
163168
SUPPORT_TEST=true
164-
165-
docker-win64:
166-
runs-on: ubuntu-latest
167-
steps:
168-
- name: Set up Docker Buildx
169-
uses: docker/setup-buildx-action@v3
170-
- name: Login to DockerHub
169+
- name: Push the stored image to Dockerhub
171170
if: ${{ github.event_name == 'push' }}
172-
uses: docker/login-action@v3
173-
with:
174-
username: ${{ secrets.DOCKERHUB_USERNAME }}
175-
password: ${{ secrets.DOCKERHUB_TOKEN }}
176-
- name: Build and push
177171
uses: docker/build-push-action@v5
178172
with:
179-
context: "{{defaultContext}}:other/docker/windows"
173+
context: other/docker/windows
180174
push: ${{ github.event_name == 'push' }}
181-
tags: toxchat/windows:win64
182-
cache-from: type=registry,ref=toxchat/windows:win64
183-
cache-to: type=inline
175+
tags: toxchat/windows:win${{ matrix.bits }}
184176
build-args: |
185-
SUPPORT_ARCH_i686=false
186-
SUPPORT_ARCH_x86_64=true
177+
SUPPORT_ARCH_i686=${{ matrix.bits == '32' }}
178+
SUPPORT_ARCH_x86_64=${{ matrix.bits == '64' }}
187179
SUPPORT_TEST=true
180+
- name: Cross-compile
181+
run: .github/scripts/cmake-win${{ matrix.bits }} script

0 commit comments

Comments
 (0)