Skip to content

chore(test-suite): upgrade relayer and remove inline comments #3572

chore(test-suite): upgrade relayer and remove inline comments

chore(test-suite): upgrade relayer and remove inline comments #3572

# Workflow running the tests of the KMS Connector components.
name: sdk-rust-sdk-tests
on:
pull_request:
push:
branches: ['main', 'release/*']
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
permissions: {}
jobs:
# Initial job that determines which components have changed
# Used by subsequent jobs to decide whether they need to run
check-changes:
name: sdk-rust-sdk-tests/check-changes
permissions:
actions: 'read' # Required to read workflow run information
contents: 'read' # Required to checkout repository code
pull-requests: 'read' # Required to read pull request information
runs-on: ubuntu-latest
outputs:
# Each output indicates if files in a specific component were modified
changes-rust-sdk: ${{ steps.filter.outputs.rust-sdk }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
# Define paths that trigger specific component workflows
# Changes to conf-trace affect multiple components
filters: |
rust-sdk:
- '.github/workflows/sdk-rust-sdk-*'
- 'sdk/rust-sdk/src/**'
- 'sdk/rust-sdk/examples/**'
- 'sdk/rust-sdk/Cargo.toml'
start-runner:
name: sdk-rust-sdk-tests/start-runner
needs: check-changes
if: ${{ needs.check-changes.outputs.changes-rust-sdk == 'true' }}
permissions:
actions: 'read' # Required to read workflow run information
contents: 'read' # Required to checkout repository code
packages: 'read' # Required to read GitHub packages/container registry
pull-requests: 'read' # Required to read pull request information
runs-on: ubuntu-latest
outputs:
label: ${{ steps.start-ec2-runner.outputs.label }}
steps:
- name: Start EC2 runner
id: start-ec2-runner
uses: zama-ai/slab-github-runner@79939325c3c429837c10d6041e4fd8589d328bac # v1.4.1
with:
mode: start
github-token: ${{ secrets.SLAB_ACTION_TOKEN }}
slab-url: ${{ secrets.SLAB_BASE_URL }}
job-secret: ${{ secrets.JOB_SECRET }}
backend: aws
profile: big-instance
test-rust-sdk:
name: sdk-rust-sdk-tests/test-rust-sdk (bpr)
needs: start-runner
timeout-minutes: 50
permissions:
actions: 'read' # Required to read workflow run information
contents: 'read' # Required to checkout repository code
packages: 'read' # Required to read GitHub packages/container registry
pull-requests: 'read' # Required to read pull request information
runs-on: ${{ needs.start-runner.outputs.label }}
defaults:
run:
shell: bash
working-directory: './sdk/rust-sdk'
steps:
- name: Checkout Project
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
token: ${{ secrets.BLOCKCHAIN_ACTIONS_TOKEN }}
persist-credentials: 'false'
- name: Setup common environment variables
run: |
echo "HOME=/home/ubuntu" >> "${GITHUB_ENV}"
echo "CARGO_NET_GIT_FETCH_WITH_CLI=true" >> "${GITHUB_ENV}"
- name: Login to GitHub Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Rust
uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b
with:
toolchain: stable
components: rustfmt, clippy
- name: Install Protoc
uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
with:
version: "26.x"
- name: Setup usage of private repo
env:
BLOCKCHAIN_ACTIONS_TOKEN: ${{ secrets.BLOCKCHAIN_ACTIONS_TOKEN }}
run: git config --global url."https://${BLOCKCHAIN_ACTIONS_TOKEN}@github.com".insteadOf ssh://[email protected]
- name: Formatting
run: cargo fmt -- --check
- name: Linting
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Gen FHE keys
env:
BLOCKCHAIN_ACTIONS_TOKEN: ${{ secrets.BLOCKCHAIN_ACTIONS_TOKEN }}
run: |
RUST_BACKTRACE=full cargo run --example keygen
- name: Run Tests
env:
BLOCKCHAIN_ACTIONS_TOKEN: ${{ secrets.BLOCKCHAIN_ACTIONS_TOKEN }}
run: |
RUST_BACKTRACE=full cargo test
- name: Run Examples
env:
BLOCKCHAIN_ACTIONS_TOKEN: ${{ secrets.BLOCKCHAIN_ACTIONS_TOKEN }}
run: |
bash scripts/run-examples.sh
stop-runner:
name: sdk-rust-sdk-tests/stop-runner
needs:
- start-runner
- test-rust-sdk
permissions:
actions: 'read' # Required to read workflow run information
contents: 'read' # Required to checkout repository code
packages: 'read' # Required to read GitHub packages/container registry
pull-requests: 'read' # Required to read pull request information
runs-on: ubuntu-latest
if: ${{ always() && needs.start-runner.result != 'skipped' }} # required to stop the runner even if the error happened in the previous jobs, but only if start-runner was not skipped
steps:
- name: Stop EC2 runner
uses: zama-ai/slab-github-runner@79939325c3c429837c10d6041e4fd8589d328bac # v1.4.1
with:
mode: stop
github-token: ${{ secrets.SLAB_ACTION_TOKEN }}
slab-url: ${{ secrets.SLAB_BASE_URL }}
job-secret: ${{ secrets.JOB_SECRET }}
label: ${{ needs.start-runner.outputs.label }}