From 2b71d91e817eac780848c7c157da1a65a64ea065 Mon Sep 17 00:00:00 2001 From: "D. Bohdan" Date: Sat, 25 May 2024 08:43:35 +0000 Subject: [PATCH] ci(github): add Mac and Windows --- .github/workflows/ci.yml | 15 +++++++++++++-- justfile | 9 +++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2da2d9b..f061443 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,15 +7,26 @@ jobs: strategy: matrix: os: + - macos-latest - ubuntu-latest + - windows-latest steps: - name: Checkout uses: actions/checkout@v4 - - name: Install dependencies + + - name: Install dependencies using Homebrew + if: ${{ matrix.os == 'macos-latest' }} + run: | + brew install expect + + - name: Install dependencies using APT + if: ${{ matrix.os == 'ubuntu-latest' }} run: | - sudo apt-get install -y expect + sudo apt-get install -y expect + - name: Set up just uses: extractions/setup-just@v2 + - name: Run tests run: | just test diff --git a/justfile b/justfile index c61c290..8bce339 100644 --- a/justfile +++ b/justfile @@ -6,20 +6,29 @@ default: test debug: cargo build +[unix] release: release-linux release-windows +[unix] release-linux: cargo build --release --target x86_64-unknown-linux-musl cp target/x86_64-unknown-linux-musl/release/jsonwatch jsonwatch-linux-x86_64 strip jsonwatch-linux-x86_64 +[unix] release-windows: cargo build --release --target i686-pc-windows-gnu cp target/i686-pc-windows-gnu/release/jsonwatch.exe jsonwatch-win32.exe strip jsonwatch-win32.exe +[unix] test: debug test-unit test-integration +[windows] +test: debug test-unit + +# The integration tests use Expect and do not work on Windows. +[unix] test-integration: {{ TCLSH }} tests/integration.tcl