diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 41cf848..edaaddb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8bcc18d..9280d52 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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