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