From e3ac2c61e56e97b5b6e10f95a1a0bec5fea2548a Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Sat, 25 Jan 2020 19:58:32 -0800 Subject: [PATCH] Expand use of Github Actions (#580) - Run on macOS, Ubuntu, and Windows - Build and test - Only lint and check completion scripts on non-windows OSs --- .github/workflows/rust.yaml | 20 ++++++++++++++++---- tests/integration.rs | 19 +++++++++++++++++++ 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rust.yaml b/.github/workflows/rust.yaml index 05c96cc..02ca37e 100644 --- a/.github/workflows/rust.yaml +++ b/.github/workflows/rust.yaml @@ -1,10 +1,16 @@ -name: Rust +name: Main on: [push] jobs: build: - runs-on: ubuntu-latest + strategy: + matrix: + os: + - macos-latest + - ubuntu-latest + - windows-latest + runs-on: ${{matrix.os}} steps: - uses: actions/checkout@v1 - name: Install @@ -19,13 +25,19 @@ jobs: rustup --version cargo --version cargo clippy --version + - name: Build + run: cargo build --all --verbose + - name: Test + run: cargo test --all --verbose - name: Clippy - run: cargo clippy + run: cargo clippy --all - name: Lint + if: matrix.os != 'windows-latest' run: cargo run lint - name: Format - run: cargo fmt -- --check + run: cargo fmt --all -- --check - name: Completion Scripts + if: matrix.os != 'windows-latest' run: | for script in completions/*; do shell=${script##*.} diff --git a/tests/integration.rs b/tests/integration.rs index 7176e14..d633500 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -2266,6 +2266,7 @@ test! { shell: false, } +#[cfg(unix)] test! { name: set_shell, justfile: " @@ -2283,6 +2284,24 @@ test! { shell: false, } +#[cfg(windows)] +test! { + name: set_shell, + justfile: " + set shell := ['echo', '-n'] + + x := `bar` + + foo: + echo {{x}} + echo foo + ", + args: (), + stdout: "-n echo -n bar\r\r\n-n echo foo\r\n", + stderr: "echo -n bar\r\necho foo\n", + shell: false, +} + test! { name: dependency_argument_string, justfile: "