name: ci-build on: pull_request: paths: - 'clients/**' - 'common/**' - 'gateway/**' - 'integrations/**' - 'nym-api/**' - 'nym-authenticator-client/**' - 'nym-credential-proxy/**' - 'nym-gateway-probe/**' - 'nym-ip-packet-client/**' - 'nym-network-monitor/**' - 'nym-node/**' - 'nym-node-status-api/**' - 'nym-registration-client/**' - 'nym-statistics-api/**' - 'nym-outfox/**' - 'nym-validator-rewarder/**' - 'nyx-chain-watcher/**' - 'sdk/ffi/**' - 'sdk/rust/**' - 'service-providers/**' - 'tools/**' - 'wasm/**' - 'Cargo.toml' - 'Cargo.lock' - '.github/workflows/ci-build.yml' workflow_dispatch: concurrency: # only 1 concurrent `ci-build` allowed per branch # https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-using-concurrency-and-the-default-behavior group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: build: strategy: fail-fast: false matrix: os: [ arc-linux-latest, custom-windows-11, custom-macos-15 ] runs-on: ${{ matrix.os }} env: CARGO_TERM_COLOR: always IPINFO_API_TOKEN: ${{ secrets.IPINFO_API_TOKEN }} RUSTUP_PERMIT_COPY_RENAME: 1 steps: - name: Install Dependencies (Linux) run: sudo apt-get update && sudo apt-get -y install libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libudev-dev squashfs-tools protobuf-compiler cmake continue-on-error: true if: contains(matrix.os, 'linux') - name: Check out repository code uses: actions/checkout@v6 - name: Install rust toolchain uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: ${{ vars.REQUIRED_RUSTC_VERSION }} override: true components: rustfmt, clippy # To avoid running out of disk space, skip generating debug symbols - name: Set debug to false (unix) if: contains(matrix.os, 'linux') || contains(matrix.os, 'mac') run: | sed -i.bak 's/\[profile.dev\]/\[profile.dev\]\ndebug = false/' Cargo.toml git diff - name: Set debug to false (win) if: contains(matrix.os, 'windows') shell: pwsh run: | (Get-Content Cargo.toml) -replace '\[profile.dev\]', "`$&`ndebug = false" | Set-Content Cargo.toml git diff - name: Check formatting uses: actions-rs/cargo@v1 with: command: fmt args: --all -- --check - name: Clippy (macos) if: contains(matrix.os, 'mac') uses: actions-rs/cargo@v1 with: command: clippy args: --workspace --all-targets --exclude nym-gateway-probe --exclude nym-node-status-api --exclude nym-node-status-agent --exclude nym-node-status-client -- -D warnings - name: Clippy (non-macos) if: contains(matrix.os, 'linux') || contains(matrix.os, 'windows') uses: actions-rs/cargo@v1 with: command: clippy args: --workspace --all-targets -- -D warnings - name: Build all binaries uses: actions-rs/cargo@v1 with: command: build args: --workspace --exclude nym-gateway-probe --exclude nym-node-status-api --exclude nym-node-status-agent --exclude nym-node-status-client # Build Go FFI-dependent crates separately (requires Go, only available on Linux CI) - name: Build nym-node-status-api and nym-node-status-agent (linux only) if: runner.os == 'Linux' uses: actions-rs/cargo@v1 with: command: build args: -p nym-node-status-api -p nym-node-status-agent - name: Build all examples if: contains(matrix.os, 'linux') uses: actions-rs/cargo@v1 with: command: build args: --workspace --examples - name: Run all tests if: contains(matrix.os, 'linux') uses: actions-rs/cargo@v1 env: NYM_API: https://sandbox-nym-api1.nymtech.net/api with: command: test args: --workspace - name: Run expensive tests if: (github.ref == 'refs/heads/develop' || github.event.pull_request.base.ref == 'develop' || github.event.pull_request.base.ref == 'master') && contains(matrix.os, 'linux') uses: actions-rs/cargo@v1 with: command: test args: --workspace -- --ignored