827c13b69e
dont build netstack in CI additional rust 2024 fixes fixes removed temp.rs first round of cleanup removed duplicated NS types moved gateway probe to the monorepo
126 lines
3.8 KiB
YAML
126 lines
3.8 KiB
YAML
name: ci-build
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- 'clients/**'
|
|
- 'common/**'
|
|
- 'gateway/**'
|
|
- 'integrations/**'
|
|
- 'nym-api/**'
|
|
- 'nym-credential-proxy/**'
|
|
- 'nym-network-monitor/**'
|
|
- 'nym-node/**'
|
|
- 'nym-node-status-api/**'
|
|
- 'nym-statistics-api/**'
|
|
- 'nym-outfox/**'
|
|
- 'nym-validator-rewarder/**'
|
|
- 'nyx-chain-watcher/**'
|
|
- 'sdk/ffi/**'
|
|
- 'sdk/rust/**'
|
|
- 'service-providers/**'
|
|
- 'nym-browser-extension/storage/**'
|
|
- '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@v4
|
|
|
|
- name: Install rust toolchain
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
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 -- -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
|
|
|
|
- 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
|