Skip to content

Commit

Permalink
feat: Enabling GCC tests on Windows thanks to MSYS2 on the GitHub's v…
Browse files Browse the repository at this point in the history
…irtual machines
  • Loading branch information
TheRustifyer committed Jul 14, 2024
1 parent 01a73a3 commit 40ee054
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
tests:
name: Run the tests - GCC
name: Run the tests - GCC Linux
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/tests-gcc-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: GCC Tests For Windows MINGW based builds

on:
push:
branches: 'main'
pull_request:
branches: '*'

jobs:
tests:
name: Run the tests - GCC MinGW Windows
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
# - { icon: '⬛', sys: mingw32 }
- { icon: '🟦', sys: mingw64 }
# - { icon: '🟨', sys: ucrt64 }
# - { icon: '🟧', sys: clang64 }
name: ${{ matrix.icon }} ${{ matrix.sys }}
defaults:
run:
shell: msys2 {0}
steps:

- name: '🧰 Checkout'
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: '${{ matrix.icon }} Setup MSYS2'
uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
cache: true
update: true
install: >-
git
pacboy: >-
toolchain:p
cmake:p
ninja:p
- name: Cache 3rd party dependencies
id: cache-3rd-party-deps-restore
uses: actions/cache/restore@v3
with:
path: |
install
key: ${{ runner.os }}-cache-3rd-party-deps


- name: Caching project dependencies
id: project-cache
uses: Swatinem/rust-cache@v2

- name: Running the tests for the project
run: |
cd zork++
RUST_LOG=trace cargo test 2>&1 gcc_windows --color=always --no-fail-fast -- --nocapture --show-output --test-threads=1

- name: Cache 3rd party dependencies
id: cache-save-3rd-party-deps
uses: actions/cache/save@v3
with:
path: |
install
key: ${{ steps.cache-3rd-party-deps-restore.outputs.cache-primary-key }}
1 change: 0 additions & 1 deletion zork++/test/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ fn test_msvc_full_process() -> Result<()> {

#[cfg(target_os = "windows")]
#[test]
#[ignore] // TODO: we need to add the `MSYS2` project on the Windows GitHub VM's
fn test_gcc_windows_full_process() -> Result<()> {
let project_name = "gcc_example";

Expand Down

0 comments on commit 40ee054

Please sign in to comment.