Skip to content

Commit

Permalink
fix: Test the current Windows Dockerfile, not an old Dockerhub image
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nurupo committed Mar 4, 2024
1 parent 14de93c commit dfb9a0b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 40 deletions.
2 changes: 2 additions & 0 deletions .github/scripts/cmake-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ docker run \
-v "$PWD:/toxcore" \
-v "$PWD/result:/prefix" \
--rm \
-t \
--pull never \
"toxchat/windows:$WINDOWS_ARCH"
14 changes: 1 addition & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
- name: Build and test
run: .github/scripts/cmake-osx

build-msvc:
build-windows-msvc:
strategy:
matrix:
version: [2019, 2022]
Expand All @@ -110,18 +110,6 @@ jobs:
cd _build
ctest -j50 --output-on-failure --rerun-failed --repeat until-pass:6 --build-config Debug
build-windows:
strategy:
matrix:
bits: [32, 64]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cross compilation
run: .github/scripts/cmake-win${{ matrix.bits }} script

build-netbsd:
runs-on: ubuntu-latest
steps:
Expand Down
48 changes: 21 additions & 27 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,15 @@ jobs:
cache-from: type=registry,ref=toxchat/c-toxcore:esp32
cache-to: type=inline

docker-win32:
docker-windows-mingw:
strategy:
matrix:
bits: [32, 64]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
Expand All @@ -149,39 +155,27 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
- name: Build and store to local Docker daemon
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}:other/docker/windows"
push: ${{ github.event_name == 'push' }}
tags: toxchat/windows:win32
cache-from: type=registry,ref=toxchat/windows:win32
cache-to: type=inline
context: other/docker/windows
load: true
tags: toxchat/windows:win${{ matrix.bits }}
cache-from: type=registry,ref=toxchat/windows:win${{ matrix.bits }}
build-args: |
SUPPORT_ARCH_i686=true
SUPPORT_ARCH_x86_64=false
SUPPORT_ARCH_i686=${{ matrix.bits == '32' }}
SUPPORT_ARCH_x86_64=${{ matrix.bits == '64' }}
SUPPORT_TEST=true
docker-win64:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
- name: Push the stored image to Dockerhub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}:other/docker/windows"
context: other/docker/windows
push: ${{ github.event_name == 'push' }}
tags: toxchat/windows:win64
cache-from: type=registry,ref=toxchat/windows:win64
cache-to: type=inline
tags: toxchat/windows:win${{ matrix.bits }}
build-args: |
SUPPORT_ARCH_i686=false
SUPPORT_ARCH_x86_64=true
SUPPORT_ARCH_i686=${{ matrix.bits == '32' }}
SUPPORT_ARCH_x86_64=${{ matrix.bits == '64' }}
SUPPORT_TEST=true
- name: Cross-compile
run: .github/scripts/cmake-win${{ matrix.bits }} script

0 comments on commit dfb9a0b

Please sign in to comment.