Skip to content

Update rust toolchain to 1.81 and deps #51

Update rust toolchain to 1.81 and deps

Update rust toolchain to 1.81 and deps #51

name: Suibase Daemon Tests
# Test for suibase-daemon
#
# These tests **rebuild** the binaries from latest in branch (does not use pre-built)
#
on:
push:
branches: ["dev"]
workflow_dispatch:
jobs:
diff:
runs-on: [ubuntu-latest]
outputs:
isChanged: ${{ steps.diff.outputs.isSuibaseDaemon }}
steps:
- uses: actions/checkout@v4
- name: Detect Changes
uses: "./.github/actions/diffs"
id: diff
- name: Upload Trigger Artifact
if: ${{ steps.diff.outputs.isSuibaseDaemon == 'true' }}
uses: actions/upload-artifact@v4
with:
name: Cargo.toml
path: ./rust/suibase/Cargo.toml
if-no-files-found: error
retention-days: 1
test:
name: Test ${{ matrix.os }}
needs: diff
if: ${{ (needs.diff.outputs.isChanged == 'true') || (github.event_name == 'workflow_dispatch') }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
steps:
- name: Free Disk Space (Ubuntu)
if: runner.os == 'Linux'
uses: jlumbroso/free-disk-space@main
with:
# 'true' means remove...
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: false # Not sure if needed for heavy link... keep it for now.
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Install Rust Toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache: "false" # Control cache in "Rust Caching" step instead.
- name: Rust suibase-daemon caching
uses: Swatinem/rust-cache@v2
env:
RUST_ADD_CACHE_KEY_COMPONENT: suibase-daemon-${{ matrix.os }}-${{ github.ref_name }}
with:
workspaces: |
rust/suibase
cache-provider: buildjet
cache-all-crates: true
- name: Sui Prerequesites (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt-get install curl cmake gcc libssl-dev pkg-config libclang-dev libpq-dev build-essential
- name: Sui Prerequesites (macOS)
if: runner.os == 'macOS'
run: |
brew install curl cmake
- name: Prepare environment
run: |
mkdir -p "$HOME/.local/bin"
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
ln -s "$GITHUB_WORKSPACE" "$HOME/suibase"
- name: Run suibase rust apps only
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
"$HOME/suibase/scripts/tests/run-all.sh" --suibase-daemon-tests
trig:
needs: test
runs-on: ubuntu-latest
steps:
- name: Create directory for artifact
run: mkdir -p ./rust/suibase
- name: Download Trigger Artifact
uses: actions/download-artifact@v4
with:
name: Cargo.toml
path: ./rust/suibase
- name: Push Cargo.toml to trigger other repos
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.SUI_BINARIES_TOKEN }}
with:
source_file: "rust/suibase/Cargo.toml"
destination_repo: "chainmovers/sui-binaries"
destination_folder: "triggers/suibase-daemon"
user_email: "[email protected]"
user_name: "Mario Fortier"