-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update GH actions for master and prs
- Loading branch information
Showing
2 changed files
with
106 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# copy of https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md | ||
# Steps for checking PRs. | ||
on: | ||
pull_request: | ||
branches: | ||
- "*" | ||
|
||
name: PR check | ||
|
||
jobs: | ||
check: | ||
name: Check | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
feature: [libp2p, waku] | ||
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 | ||
continue-on-error: true | ||
with: | ||
command: check | ||
args: --all --no-default-features --features ${{ matrix.feature }} | ||
|
||
test: | ||
name: Test Suite | ||
if: ${{ !startsWith(github.event.pull_request.title, '[WIP]') && !contains(github.event.label.name, 'DO NOT MERGE') }} | ||
strategy: | ||
fail-fast: false # all OSes should be tested even if one fails (default: true) | ||
matrix: | ||
feature: [libp2p, waku] | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
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' | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
continue-on-error: true | ||
with: | ||
command: build | ||
args: --all --no-default-features --features ${{ matrix.feature }} | ||
- uses: actions-rs/cargo@v1 | ||
continue-on-error: true | ||
with: | ||
command: test | ||
args: --all --no-default-features --features ${{ matrix.feature }} | ||
|
||
lints: | ||
name: Rust lints | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
feature: [libp2p, waku] | ||
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 | ||
continue-on-error: true | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
|
||
- name: Run cargo clippy | ||
uses: actions-rs/cargo@v1 | ||
continue-on-error: true | ||
with: | ||
command: clippy | ||
args: --all --no-default-features --features ${{ matrix.feature }} -- --deny warnings |