2022-11-23 13:10:17 +00:00
|
|
|
# copy of https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md
|
2022-12-01 16:46:27 +00:00
|
|
|
# These tasks are supposed to run when updating the main branch.
|
|
|
|
# The steps are identical to those that run on PRs, but this script includes macos environment.
|
|
|
|
on:
|
|
|
|
push:
|
2023-06-15 09:48:36 +00:00
|
|
|
branches: [master]
|
2022-11-23 13:10:17 +00:00
|
|
|
|
2023-06-15 09:48:36 +00:00
|
|
|
name: Master branch updates check
|
2022-11-23 13:10:17 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
check:
|
|
|
|
name: Check
|
|
|
|
runs-on: ubuntu-latest
|
2023-09-01 07:45:53 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: true
|
|
|
|
matrix:
|
|
|
|
feature: [libp2p, waku]
|
2022-11-23 13:10:17 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
submodules: true
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
- uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: check
|
2023-09-01 07:45:53 +00:00
|
|
|
args: --all --no-default-features --features ${{ matrix.feature }}
|
2022-11-23 13:10:17 +00:00
|
|
|
|
2023-09-04 07:27:13 +00:00
|
|
|
test:
|
|
|
|
name: Test Suite
|
2022-11-23 13:10:17 +00:00
|
|
|
strategy:
|
2022-12-01 16:46:27 +00:00
|
|
|
fail-fast: false # all OSes should be tested even if one fails (default: true)
|
2022-11-23 13:10:17 +00:00
|
|
|
matrix:
|
2023-09-01 07:45:53 +00:00
|
|
|
feature: [libp2p, waku]
|
|
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
2022-11-23 13:10:17 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
submodules: true
|
|
|
|
- uses: actions/setup-go@v3 # we need go to build go-waku
|
|
|
|
with:
|
|
|
|
go-version: '1.19'
|
2023-09-04 07:27:13 +00:00
|
|
|
# Setup Rust toolchain with GNU for Windows
|
|
|
|
- name: Setup Rust with GNU toolchain (Windows)
|
|
|
|
if: matrix.os == 'windows-latest'
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable-gnu
|
2023-09-04 10:28:07 +00:00
|
|
|
target: x86_64-pc-windows-gnu
|
2023-09-04 07:27:13 +00:00
|
|
|
override: true
|
|
|
|
# Setup Rust toolchain for other OSes
|
|
|
|
- name: Setup Rust toolchain (Other OSes)
|
|
|
|
if: matrix.os != 'windows-latest'
|
|
|
|
uses: actions-rs/toolchain@v1
|
2022-11-23 13:10:17 +00:00
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
- uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: build
|
2023-09-01 07:45:53 +00:00
|
|
|
args: --all --no-default-features --features ${{ matrix.feature }}
|
2022-11-23 13:10:17 +00:00
|
|
|
- uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: test
|
2023-09-04 07:27:13 +00:00
|
|
|
args: --all --no-default-features --features ${{ matrix.feature }} -- --skip ten_nodes_happy --skip two_nodes_happy --skip ten_nodes_one_down
|
2022-11-23 13:10:17 +00:00
|
|
|
|
|
|
|
lints:
|
|
|
|
name: Rust lints
|
|
|
|
runs-on: ubuntu-latest
|
2023-09-04 10:28:07 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
feature: [libp2p, waku]
|
2022-11-23 13:10:17 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
submodules: true
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
components: rustfmt, clippy
|
|
|
|
|
|
|
|
- name: Run cargo fmt
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: fmt
|
|
|
|
args: --all -- --check
|
|
|
|
|
|
|
|
- name: Run cargo clippy
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: clippy
|
2023-09-01 07:45:53 +00:00
|
|
|
args: --all --no-default-features --features ${{ matrix.feature }} -- --deny warnings
|