From 3335066414cbc686ca0012d07b4b525aeb5ee249 Mon Sep 17 00:00:00 2001 From: Shayne Fletcher Date: Fri, 12 Jan 2024 10:07:10 -0500 Subject: [PATCH] add macos & windows jobs --- .github/actions/cargo_build_and_test/action.yml | 9 +++++++++ .github/actions/setup_linux_env/action.yml | 3 +-- .github/actions/setup_macos_env/action.yml | 16 ++++++++++++++++ .github/actions/setup_windows_env/action.yml | 16 ++++++++++++++++ .github/workflows/build-and-test.yml | 15 +++++++++++++-- 5 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 .github/actions/cargo_build_and_test/action.yml create mode 100644 .github/actions/setup_macos_env/action.yml create mode 100644 .github/actions/setup_windows_env/action.yml diff --git a/.github/actions/cargo_build_and_test/action.yml b/.github/actions/cargo_build_and_test/action.yml new file mode 100644 index 00000000..28117b57 --- /dev/null +++ b/.github/actions/cargo_build_and_test/action.yml @@ -0,0 +1,9 @@ +name: Cargo build and test +description: Use Cargo to build and test Reindeer +runs: + using: composite + steps: + - run: cargo build --locked + shell: bash + - run: cargo test + shell: bash diff --git a/.github/actions/setup_linux_env/action.yml b/.github/actions/setup_linux_env/action.yml index b68c2144..d6e10c37 100644 --- a/.github/actions/setup_linux_env/action.yml +++ b/.github/actions/setup_linux_env/action.yml @@ -1,6 +1,5 @@ name: Setup Linux environment -description: | - Setup Linux environment for building and testing Reindeer. +description: Setup Linux environment for building and testing Reindeer runs: using: composite steps: diff --git a/.github/actions/setup_macos_env/action.yml b/.github/actions/setup_macos_env/action.yml new file mode 100644 index 00000000..fcbc9160 --- /dev/null +++ b/.github/actions/setup_macos_env/action.yml @@ -0,0 +1,16 @@ +name: Setup macOS environment +description: Setup macOS environment for building and testing Reindeer +runs: + using: composite + steps: + - uses: SebRollen/toml-action@v1.0.2 + id: read_rust_toolchain + with: + file: rust-toolchain + field: toolchain.channel + - uses: dtolnay/rust-toolchain@v1 + with: + toolchain: ${{ steps.read_rust_toolchain.outputs.value }} + - uses: Swatinem/rust-cache@v2 + with: + prefix-key: reindeer-upload diff --git a/.github/actions/setup_windows_env/action.yml b/.github/actions/setup_windows_env/action.yml new file mode 100644 index 00000000..9be847f4 --- /dev/null +++ b/.github/actions/setup_windows_env/action.yml @@ -0,0 +1,16 @@ +name: Setup Windows environment +description: Setup Windows environment for building and testing Reindeer +runs: + using: composite + steps: + - uses: SebRollen/toml-action@v1.0.2 + id: read_rust_toolchain + with: + file: rust-toolchain + field: toolchain.channel + - uses: dtolnay/rust-toolchain@v1 + with: + toolchain: ${{ steps.read_rust_toolchain.outputs.value }} + - uses: Swatinem/rust-cache@v2 + with: + prefix-key: reindeer-upload diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 6279b0b3..80f8005a 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -8,5 +8,16 @@ jobs: steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup_linux_env - - run: cargo build --locked - - run: cargo test + - uses: ./.github/actions/cargo_build_and_test + macos-build-and-test: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup_macos_env + - uses: ./.github/actions/cargo_build_and_test + windows-build-and-test: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup_windows_env + - uses: ./.github/actions/cargo_build_and_test