Skip to content

update the repo to project liberty labs (#212) #624

update the repo to project liberty labs (#212)

update the repo to project liberty labs (#212) #624

Workflow file for this run

name: Verify PR Commit
concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true
on:
pull_request:
branches:
- main
push :
branches:
- main
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUSTFLAGS: -D warnings
jobs:
verify:
name: Check PR Commit
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Rust Toolchain
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
toolchain: stable
default: true
profile: minimal
target: wasm32-unknown-unknown
- name: Cargo check
run: make check
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Rust Toolchain
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
toolchain: stable
default: true
profile: minimal
target: wasm32-unknown-unknown
- name: Cargo test
run: make test
lint:
name: Run linter
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Rust Toolchain
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
toolchain: nightly-2023-12-28
default: true
profile: default
target: wasm32-unknown-unknown
override: true
- name: Cargo fmt
run: make format-check
deny:
name: Cargo Deny
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Rust Toolchain
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
toolchain: stable
default: true
profile: minimal
target: wasm32-unknown-unknown
- name: Set Up Cargo Deny
run: |
cargo install --force cargo-deny
cargo generate-lockfile
- name: License and Issue Check
run: make deny
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Rust Toolchain
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
toolchain: stable
default: true
profile: minimal
target: wasm32-unknown-unknown
- name: Cargo build
run: make build
test_binary:
name: Generate bindgen and run c_example
runs-on: ubuntu-latest
needs: [verify, test, lint, build]
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Rust Toolchain
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
toolchain: nightly
default: true
profile: minimal
- name: Install libsodium
run: sudo apt-get install -y libsodium-dev
- name: Run tests for ffi
run: make test-ffi
- name: Upload artifacts dsnp_graph_sdk_ffi.h and libdsnp_graph_sdk_ffi.a
uses: actions/upload-artifact@v2
with:
name: dsnp_graph_sdk_ffi
path: |
bridge/ffi/src/c_example/dsnp_graph_sdk_ffi.h
bridge/ffi/src/c_example/libdsnp_graph_sdk_ffi.a
bridge/ffi/src/c_example/main.c
generate-docs:
name: Generate graph sdk rust docs
runs-on: ubuntu-latest
needs: [verify, test, lint, build]
permissions:
contents: read
packages: write
pages: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Rust Toolchain
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
toolchain: stable
default: true
profile: minimal
target: wasm32-unknown-unknown
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Build Docs
run: |
RUSTC_BOOTSTRAP=1 RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo doc --no-deps --all-features
- name: Fix file permissions
shell: sh
run: |
chmod -c -R +rX "target/doc" |
while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
build_gradlew_jvm:
name: Build JVM
runs-on: ubuntu-latest
needs: [verify, test, lint, build]
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2
with:
java-version: '17'
distribution: 'adopt'
- name: Build JNI package
run: make build-jni
- name: Build and Publish with Gradle
working-directory: java
run: ./gradlew build
build_test_node_bridge:
name: Build and Test Node Bridge
runs-on: ubuntu-latest
needs: [verify, test, lint, build]
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Build Node Bridge
run: make test-node
# Uncomment after first deployment
# test_java_lib_gradle:
# name: Test Java Library
# runs-on: ubuntu-latest
# needs: [verify, test, lint, build, build_gradlew_jvm]
# permissions:
# contents: read
# packages: write
# steps:
# - uses: actions/checkout@v3
# - name: Set up Java
# uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2
# with:
# java-version: '17'
# distribution: 'adopt'
# - name: Test Java Library
# working-directory: java/example-graphsdk-client
# run: ./gradlew test
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# GITHUB_ACTOR: ${{ github.actor }}
#
# test_published_npm:
# name: Test Published NPM Package
# runs-on: ubuntu-latest
# needs: [verify, test, lint, build, build_gradlew_jvm]
# permissions:
# contents: read
# packages: write
# steps:
# - uses: actions/checkout@v3
# - name: Set up Node
# uses: actions/setup-node@v3
# with:
# node-version: '18.x'
# registry-url: https://registry.npmjs.org/
# - name: Install NPM Dependencies
# working-directory: bridge/node/node-example-client
# run: npm install
# - name: Test Published NPM Package
# working-directory: bridge/node/node-example-client
# run: npm run test
# env:
# NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}