Merge pull request #147 to update readme #493
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
name: "Building and testing Rust and UniFFI interface" | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./lib | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: "true" | |
- name: Setting up Ruby env | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: "3.2.0" | |
- run: gem install ffi --no-document | |
- name: Set up cargo cache | |
uses: actions/cache@v3 | |
continue-on-error: false | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
lib/target | |
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: ${{ runner.os }}-cargo-build | |
- name: Set up Zcash params cache | |
uses: actions/cache@v3 | |
continue-on-error: false | |
with: | |
path: | | |
~/.zcash-params/ | |
key: zcash-params-${{ hashFiles('.zcash-params/**') }} | |
restore-keys: zcash-params | |
- name: 🔨 Build | |
run: cargo build --verbose | |
- name: 🔎 Test | |
run: | | |
cargo run -p uniffi-zcash-cli setup saplingparams | |
cargo test --verbose | |
bindgen: | |
name: "Generate binding languages files and upload" | |
needs: build | |
uses: ./.github/workflows/bindgen.yml | |
with: | |
artifacts-storage-prefix: "build-test" | |
secrets: | |
languages: ${{ secrets.LANGUAGES }} | |
build-packages: | |
name: "Build on Ubuntu" | |
needs: bindgen | |
# Kotlin variables/secrets only need to be present, without value, | |
# in the build stage, as they are checked by gradle. | |
# They are required because we use System.getenv() | |
# in the build.gradle.kts template for security reasons. | |
uses: ./.github/workflows/packages.yml | |
with: | |
runs-on: ubuntu-latest | |
version: "0.0.0" # dummy version we are only testing the build. | |
artifacts-storage-prefix: "build-test" | |
save-artifacts: false | |
secrets: | |
git-user-name: ${{ secrets.GIT_USER_NAME }} | |
git-user-email: ${{ secrets.GIT_USER_EMAIL }} | |
kotlin-registry-url: "" # dummy, we are testing the build. | |
kotlin-registry-username: "" # dummy, we are testing the build. | |
kotlin-registry-password: "" # dummy, we are testing the build. | |
# Swift needs to clone the package repo for build. | |
swift-git-repo-url: ${{ secrets.SWIFT_GIT_REPO_URL }} | |
macos-build-packages: | |
name: "Build on MacOS" | |
needs: bindgen | |
# Kotlin variables/secrets only need to be present, without value, | |
# in the build stage, as they are checked by gradle. | |
# They are required because we use System.getenv() | |
# in the build.gradle.kts template for security reasons. | |
uses: ./.github/workflows/packages.yml | |
with: | |
# We are using a fixed-version SDK (see bindgen) | |
# so we need to keep in check the MacOS version used. | |
runs-on: macos-latest | |
version: "0.0.0" # dummy version we are only testing the build. | |
artifacts-storage-prefix: "build-test" | |
save-artifacts: false | |
secrets: | |
git-user-name: ${{ secrets.GIT_USER_NAME }} | |
git-user-email: ${{ secrets.GIT_USER_EMAIL }} | |
kotlin-registry-url: "" # dummy, we are testing the build. | |
kotlin-registry-username: "" # dummy, we are testing the build. | |
kotlin-registry-password: "" # dummy, we are testing the build. | |
# Swift needs to clone the package repo for build. | |
swift-git-repo-url: ${{ secrets.SWIFT_GIT_REPO_URL }} |