Skip to content

Commit

Permalink
ci: update to add cache
Browse files Browse the repository at this point in the history
  • Loading branch information
jhamill34 committed Jul 7, 2023
1 parent 7f45b0a commit e326a82
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit e326a82

Please # to comment.