cache rust dependencies
@@ -11,6 +11,7 @@ env:
jobs:
bind_gen:
+ name: C Bindings
runs-on: ubuntu-latest
outputs:
rust_hash: ${{ steps.rust_headers_hash.outputs.rust_hash }}
@@ -50,17 +51,15 @@ jobs:
name: Build bindings on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: bind_gen
- outputs:
- binary_hash: ${{ steps.rust_headers_hash.outputs.rust_hash }}
strategy:
- # fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v3
- - name: Get cached C bindings
+ - name: Cache C bindings
+ id: cache_bind_gen
uses: actions/cache@v3
with:
key: cbindgen-${{ needs.bind_gen.outputs.rust_hash }}
@@ -68,8 +67,21 @@ jobs:
bindings/native/go/dist/*.h
bindings/native/go/dist/*.hpp
+ - name: Cache Rust dependencies
+ uses: actions/cache@v3
+ with:
+ key: ${{ matrix.os }}-rust-${{ needs.bind_gen.outputs.rust_hash }}
+ path: |
+ ~/.cargo/bin/**
+ ~/.cargo/registry/index/**
+ ~/.cargo/registry/cache/**
+ ~/.cargo/git/**
+ ~/.cargo/.crates.toml
+ ~/.cargo/.crates2.json
+ target/**
+
- name: Fail if C bindings could not be found
- if: ${{ steps.cache_bind_gen.outputs.cache-hit == true }}
+ if: ${{ steps.cache_bind_gen.outputs.cache-hit == false }}
uses: actions/github-script@v6
with:
script: core.setFailed(`Actions failed to find the cached generated C bindings`);
@@ -108,7 +120,7 @@ jobs:
target/release/*stronghold_native.dylib
release:
- name: Compile universal Go module
+ name: Create universal Go module
runs-on: ubuntu-latest
needs: build
steps:
@@ -143,14 +155,15 @@ jobs:
with:
name: go-libstronghold
if-no-files-found: error
+ # bindings/native/go/go.*
+ # bindings/native/go/*.go
+ # bindings/native/go/dist/*stronghold_native.dll
+ # bindings/native/go/dist/*stronghold_native.so
+ # bindings/native/go/dist/*stronghold_native.dylib
+ # bindings/native/go/dist/*.h
+ # bindings/native/go/dist/*.hpp
path: |
- bindings/native/go/go.*
- bindings/native/go/*.go
- bindings/native/go/dist/*stronghold_native.dll
- bindings/native/go/dist/*stronghold_native.so
- bindings/native/go/dist/*stronghold_native.dylib
- bindings/native/go/dist/*.h
- bindings/native/go/dist/*.hpp
+ bindings/native/go/**
!bindings/native/go/tests/**
!bindings/native/go/*/build/**
!bindings/native/go/*/deps/**
