Skip to content

Merge pull request #786 from rustaceanrob/remove-webhook #17

Merge pull request #786 from rustaceanrob/remove-webhook

Merge pull request #786 from rustaceanrob/remove-webhook #17

Workflow file for this run

name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push events but only for the "main" branch
push:
branches: [ main ]
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run Format
run: |
cd libs
cargo fmt -- --check
cd ../tools/sdk-cli
cargo fmt -- --check
build-core:
name: Test sdk-core
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install rust
run: |
rustup set auto-self-update disable
rustup toolchain install stable --profile minimal
- uses: Swatinem/rust-cache@v2
with:
workspaces: libs/sdk-core -> ../target
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
version: "23.4"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run sdk-core tests
working-directory: libs/sdk-core
run: cargo test
build-bindings:
name: Test sdk-bindings
runs-on: macOS-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install rust
run: |
rustup set auto-self-update disable
rustup toolchain install stable --profile minimal
- uses: Swatinem/rust-cache@v2
with:
workspaces: libs/sdk-bindings -> ../target
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
version: "23.4"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build sdk-bindings
working-directory: libs/sdk-bindings
run: cargo build
- name: Build C# bindings
working-directory: libs/sdk-bindings
run: |
cargo install uniffi-bindgen-cs --git https://github.com/breez/uniffi-bindgen-cs --branch namespace
uniffi-bindgen-cs src/breez_sdk.udl -o ffi/csharp -c ./uniffi.toml
cp ../target/debug/libbreez_sdk_bindings.dylib ffi/csharp
- name: Build golang bindings
working-directory: libs/sdk-bindings
run: |
cargo install uniffi-bindgen-go --git https://github.com/NordSecurity/uniffi-bindgen-go --tag v0.1.5+v0.23.0
uniffi-bindgen-go src/breez_sdk.udl -o ffi/golang -c ./uniffi.toml
cp ../target/debug/libbreez_sdk_bindings.dylib ffi/golang
cp -r ffi/golang/breez/breez_sdk tests/bindings/golang/
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: '1.19.9'
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Run sdk-bindings tests
run: |
curl -o jna-5.12.1.jar https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.12.1/jna-5.12.1.jar
export CLASSPATH=$(pwd)/jna-5.12.1.jar;
cd libs/sdk-bindings
cargo test
build-cli:
name: Test sdk-cli
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install rust
run: |
rustup set auto-self-update disable
rustup toolchain install stable --profile minimal
- uses: Swatinem/rust-cache@v2
with:
workspaces: tools/sdk-cli -> target
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
version: "23.4"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run tools tests
working-directory: tools/sdk-cli
run: cargo test
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install rust
run: |
rustup set auto-self-update disable
rustup toolchain install stable --profile minimal
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
libs -> target
tools/sdk-cli -> target
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
version: "23.4"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: clippy
run: |
cd libs
# Explicitly allow clippy::uninlined-format-args lint because it's present in the generated breez_sdk.uniffi.rs
cargo clippy -- -D warnings -A clippy::uninlined-format-args
cargo clippy --tests -- -D warnings -A clippy::uninlined-format-args
cd ../tools/sdk-cli
cargo clippy -- -D warnings
react-native:
name: Check react native
runs-on: macOS-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install rust
run: |
rustup set auto-self-update disable
rustup toolchain install stable --profile minimal
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
libs -> target
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
version: "23.4"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: React native codegen
working-directory: libs/sdk-react-native
run: |
yarn global add tslint typescript
brew update
brew install kotlin ktlint swiftformat
make react-native-codegen
- name: Check git status
env:
GIT_PAGER: cat
run: |
status=$(git status --porcelain)
if [[ -n "$status" ]]; then
echo "Git status has changes"
echo "$status"
git diff
exit 1
else
echo "No changes in git status"
fi
flutter:
name: Check flutter
runs-on: macOS-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install rust
run: |
rustup set auto-self-update disable
rustup toolchain install stable --profile minimal
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
libs -> target
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
version: "23.4"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Flutter bridge codegen
working-directory: libs/sdk-flutter
run: |
make init
make flutter_rust_bridge
- name: Check git status
env:
GIT_PAGER: cat
run: |
status=$(git status --porcelain)
if [[ -n "$status" ]]; then
echo "Git status has changes"
echo "$status"
git diff
exit 1
else
echo "No changes in git status"
fi
- name: dart-analyze
run: dart analyze --fatal-infos
- name: dart-format
run: dart format -o none --set-exit-if-changed -l 110 .