-
Notifications
You must be signed in to change notification settings - Fork 4
116 lines (103 loc) · 3.66 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
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 }}