build(github CI): add cargo cache (#109)
This commit is contained in:
parent
81c2d6ddd7
commit
f74724763c
|
@ -20,6 +20,15 @@ jobs:
|
|||
- name: install target
|
||||
run: rustup target add aarch64-apple-darwin
|
||||
|
||||
- name: cargo cache artifacts
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
target
|
||||
key: ${{ runner.os }}-${{ runner.arch }}-cargo-build-target-${{ hashFiles('Cargo.lock') }}
|
||||
|
||||
- name: build
|
||||
run: cargo build --package cli --release --target aarch64-apple-darwin
|
||||
|
||||
|
@ -57,6 +66,15 @@ jobs:
|
|||
- name: install target
|
||||
run: rustup target add x86_64-apple-darwin
|
||||
|
||||
- name: cargo cache artifacts
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
target
|
||||
key: ${{ runner.os }}-${{ runner.arch }}-cargo-build-target-${{ hashFiles('Cargo.lock') }}
|
||||
|
||||
- name: build
|
||||
run: cargo build --package cli --release --target x86_64-apple-darwin
|
||||
|
||||
|
@ -100,6 +118,15 @@ jobs:
|
|||
sudo apt-get install -y gcc-aarch64-linux-gnu
|
||||
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
|
||||
|
||||
- name: cargo cache artifacts
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
target
|
||||
key: ${{ runner.os }}-${{ runner.arch }}-cargo-build-target-${{ hashFiles('Cargo.lock') }}
|
||||
|
||||
- name: build
|
||||
run: cargo build --package cli --release --target aarch64-unknown-linux-gnu
|
||||
|
||||
|
@ -137,6 +164,15 @@ jobs:
|
|||
- name: install target
|
||||
run: rustup target add x86_64-unknown-linux-gnu
|
||||
|
||||
- name: cargo cache artifacts
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
target
|
||||
key: ${{ runner.os }}-${{ runner.arch }}-cargo-build-target-${{ hashFiles('Cargo.lock') }}
|
||||
|
||||
- name: build
|
||||
run: cargo build --package cli --release --target x86_64-unknown-linux-gnu
|
||||
|
||||
|
|
|
@ -17,6 +17,13 @@ jobs:
|
|||
profile: minimal
|
||||
toolchain: nightly
|
||||
override: true
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
target
|
||||
key: ${{ runner.os }}-${{ runner.arch }}-cargo-build-target-${{ hashFiles('Cargo.lock') }}
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: check
|
||||
|
@ -31,6 +38,13 @@ jobs:
|
|||
profile: minimal
|
||||
toolchain: nightly
|
||||
override: true
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
target
|
||||
key: ${{ runner.os }}-${{ runner.arch }}-cargo-build-target-${{ hashFiles('Cargo.lock') }}
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: test
|
||||
|
@ -47,6 +61,13 @@ jobs:
|
|||
toolchain: nightly
|
||||
override: true
|
||||
- run: rustup component add rustfmt
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
target
|
||||
key: ${{ runner.os }}-${{ runner.arch }}-cargo-build-target-${{ hashFiles('Cargo.lock') }}
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
|
|
Loading…
Reference in New Issue