2022-03-16 13:21:31 +08:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2022-11-15 16:35:29 +05:30
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
|
|
|
- '!.github/workflows/*.yml'
|
2023-07-24 10:14:49 +02:00
|
|
|
- '!multiplier/src/**'
|
2022-11-15 16:35:29 +05:30
|
|
|
- '!private-settlement/src/**'
|
|
|
|
- '!rln-wasm/**'
|
2022-11-22 15:25:35 +01:00
|
|
|
- '!rln/src/**'
|
2022-12-09 17:19:55 +01:00
|
|
|
- '!rln/resources/**'
|
2022-11-15 16:35:29 +05:30
|
|
|
- '!semaphore/src/**'
|
2022-11-22 15:25:35 +01:00
|
|
|
- '!utils/src/**'
|
2022-03-16 13:21:31 +08:00
|
|
|
pull_request:
|
2022-11-15 16:35:29 +05:30
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
|
|
|
- '!.github/workflows/*.yml'
|
2023-07-24 10:14:49 +02:00
|
|
|
- '!multiplier/src/**'
|
2022-11-15 16:35:29 +05:30
|
|
|
- '!private-settlement/src/**'
|
|
|
|
- '!rln-wasm/**'
|
2022-11-22 15:25:35 +01:00
|
|
|
- '!rln/src/**'
|
2022-12-09 17:19:55 +01:00
|
|
|
- '!rln/resources/**'
|
2022-11-15 16:35:29 +05:30
|
|
|
- '!semaphore/src/**'
|
2022-11-22 15:25:35 +01:00
|
|
|
- '!utils/src/**'
|
2022-11-15 16:35:29 +05:30
|
|
|
|
2022-03-16 13:21:31 +08:00
|
|
|
|
|
|
|
name: Tests
|
|
|
|
|
|
|
|
jobs:
|
2023-05-29 23:42:30 +05:30
|
|
|
test:
|
2022-11-22 15:25:35 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
platform: [ubuntu-latest, macos-latest]
|
2023-07-24 10:14:49 +02:00
|
|
|
crate: [multiplier, semaphore, rln, utils]
|
2022-11-22 15:25:35 +01:00
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
timeout-minutes: 60
|
|
|
|
|
2023-05-29 23:42:30 +05:30
|
|
|
name: test - ${{ matrix.crate }} - ${{ matrix.platform }}
|
2022-11-22 15:25:35 +01:00
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
2023-05-29 23:42:30 +05:30
|
|
|
uses: actions/checkout@v3
|
2022-11-22 15:25:35 +01:00
|
|
|
- name: Install stable toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
2023-03-14 17:44:06 +05:30
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
- name: Install dependencies
|
|
|
|
run: make installdeps
|
2023-01-31 20:46:33 +05:30
|
|
|
- name: cargo-make test
|
2022-11-22 15:25:35 +01:00
|
|
|
run: |
|
2023-01-31 20:46:33 +05:30
|
|
|
cargo make test --release
|
2023-05-29 23:42:30 +05:30
|
|
|
working-directory: ${{ matrix.crate }}
|
2022-11-22 15:25:35 +01:00
|
|
|
|
|
|
|
rln-wasm:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
platform: [ubuntu-latest, macos-latest]
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
timeout-minutes: 60
|
|
|
|
|
2023-05-29 23:42:30 +05:30
|
|
|
name: test - rln-wasm - ${{ matrix.platform }}
|
2022-09-28 01:09:48 +10:00
|
|
|
steps:
|
2023-05-29 23:42:30 +05:30
|
|
|
- uses: actions/checkout@v3
|
2022-09-28 01:09:48 +10:00
|
|
|
- name: Install stable toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
2023-03-14 17:44:06 +05:30
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
- name: Install Dependencies
|
|
|
|
run: make installdeps
|
2022-09-28 01:09:48 +10:00
|
|
|
- name: Install wasm-pack
|
|
|
|
uses: jetli/wasm-pack-action@v0.3.0
|
|
|
|
- run: cargo make build
|
|
|
|
working-directory: rln-wasm
|
2023-05-18 11:33:45 +05:30
|
|
|
- run: cargo make test --release
|
2022-09-28 01:09:48 +10:00
|
|
|
working-directory: rln-wasm
|
2022-11-22 15:25:35 +01:00
|
|
|
|
2022-03-16 13:21:31 +08:00
|
|
|
lint:
|
2022-11-22 15:25:35 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
# we run lint tests only on ubuntu
|
|
|
|
platform: [ubuntu-latest]
|
2023-07-24 10:14:49 +02:00
|
|
|
crate: [multiplier, semaphore, rln, utils]
|
2022-11-22 15:25:35 +01:00
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
timeout-minutes: 60
|
|
|
|
|
2023-05-29 23:42:30 +05:30
|
|
|
name: lint - ${{ matrix.crate }} - ${{ matrix.platform }}
|
2022-03-16 13:21:31 +08:00
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
2023-05-29 23:42:30 +05:30
|
|
|
uses: actions/checkout@v3
|
2022-03-16 13:21:31 +08:00
|
|
|
- name: Install stable toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
components: rustfmt, clippy
|
2023-03-14 17:44:06 +05:30
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
- name: Install Dependencies
|
|
|
|
run: make installdeps
|
2022-03-16 13:21:31 +08:00
|
|
|
- name: cargo fmt
|
2022-11-22 15:25:35 +01:00
|
|
|
if: success() || failure()
|
2023-05-29 23:42:30 +05:30
|
|
|
run: cargo fmt -- --check
|
|
|
|
working-directory: ${{ matrix.crate }}
|
|
|
|
- name: cargo clippy
|
2022-11-22 15:25:35 +01:00
|
|
|
if: success() || failure()
|
2022-09-20 08:22:46 -04:00
|
|
|
run: |
|
2023-02-06 05:54:59 +01:00
|
|
|
cargo clippy --release -- -D warnings
|
2023-05-29 23:42:30 +05:30
|
|
|
working-directory: ${{ matrix.crate }}
|
2022-11-22 15:25:35 +01:00
|
|
|
# We skip clippy on rln-wasm, since wasm target is managed by cargo make
|
2022-03-17 15:45:20 +08:00
|
|
|
# Currently not treating warnings as error, too noisy
|
2023-05-29 23:42:30 +05:30
|
|
|
# -- -D warnings
|
|
|
|
benchmark:
|
2023-05-30 12:22:06 +05:30
|
|
|
# run only in pull requests
|
|
|
|
if: github.event_name == 'pull_request'
|
2023-05-29 23:42:30 +05:30
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
# we run benchmark tests only on ubuntu
|
|
|
|
platform: [ubuntu-latest]
|
|
|
|
crate: [rln, utils]
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
timeout-minutes: 60
|
|
|
|
|
|
|
|
name: benchmark - ${{ matrix.platform }} - ${{ matrix.crate }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
- uses: boa-dev/criterion-compare-action@v3
|
|
|
|
with:
|
|
|
|
branchName: ${{ github.base_ref }}
|
|
|
|
cwd: ${{ matrix.crate }}
|