From e326a82e1b14a6e5f90b63c28f9a93e9d1680921 Mon Sep 17 00:00:00 2001 From: Josh Hamill Date: Fri, 7 Jul 2023 16:34:58 -0400 Subject: [PATCH] ci: update to add cache --- .github/workflows/rust.yml | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 98223b9..646c0e5 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -11,16 +11,32 @@ env: jobs: test: name: test - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - target: aarch64-apple-darwin + os: macos-latest + steps: - name: Checkout uses: actions/checkout@v3 + - name: Cache + uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ matrix.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Install Rust uses: actions-rs/toolchain@v1 with: toolchain: stable profile: minimal override: true + target: ${{ matrix.target }} - name: Format Check uses: actions-rs/cargo@v1 @@ -55,6 +71,15 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + - name: Cache + uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ matrix.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Install Rust uses: actions-rs/toolchain@v1 with: @@ -75,7 +100,9 @@ jobs: run: | mkdir -p dist/rover-${{ github.ref_name }}-${{ matrix.target }} mv target/${{ matrix.target }}/release/rover dist/rover-${{ github.ref_name }}-${{ matrix.target }}/ - tar -czvf dist/rover-${{ github.ref_name }}-${{ matrix.target }}.tar.gz dist/rover-${{ github.ref_name }}-${{ matrix.target }}/ + cd dist + tar -czvf rover-${{ github.ref_name }}-${{ matrix.target }}.tar.gz rover-${{ github.ref_name }}-${{ matrix.target }}/ + cd .. - name: Publish uses: softprops/action-gh-release@v1