diff --git a/.github/workflows/stellar-build-and-test.yml b/.github/workflows/stellar-build-and-test.yml index 978229f9..cac0ef80 100644 --- a/.github/workflows/stellar-build-and-test.yml +++ b/.github/workflows/stellar-build-and-test.yml @@ -1,4 +1,4 @@ -name: Build and Test Stellar contracts +name: Build and Test Stellar Contracts on: push: branches: @@ -14,6 +14,7 @@ on: defaults: run: working-directory: contracts/soroban + jobs: Build: name: Build Stellar Contracts @@ -24,6 +25,30 @@ jobs: with: submodules: true + - name: Cache Cargo Registry + uses: actions/cache@v3 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo-registry- + + - name: Cache Cargo Index + uses: actions/cache@v3 + with: + path: ~/.cargo/git + key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo-index- + + - name: Cache Build Target + uses: actions/cache@v3 + with: + path: target + key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo-target- + - name: Install stable toolchain uses: actions-rs/toolchain@v1 with: @@ -38,6 +63,5 @@ jobs: cargo install --locked soroban-cli - name: Build & Test Stellar Contracts - working-directory: contracts/soroban run: | - soroban contract build + soroban contract build