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 Feb 28, 2024
1 parent 7de4889 commit bdf1b28
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 39 deletions.
1 change: 1 addition & 0 deletions .github/scripts/cmake-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ docker run \
-v "$PWD:/toxcore" \
-v "$PWD/result:/prefix" \
--rm \
--pull never \
"toxchat/windows:$WINDOWS_ARCH"
12 changes: 0 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
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 load
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
context: other/docker/windows
load: true
tags: toxchat/windows:win${{ matrix.bits }}
cache-from: type=registry,ref=toxchat/windows:win${{ matrix.bits }}
cache-to: type=inline
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
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
- name: Push loaded
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 compilation
run: .github/scripts/cmake-win${{ matrix.bits }} script

0 comments on commit bdf1b28

Please sign in to comment.