-
Notifications
You must be signed in to change notification settings - Fork 18
100 lines (94 loc) · 2.76 KB
/
pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# 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
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'
# 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
target: x86_64-pc-windows-gnu
override: true
# Setup Rust toolchain for other OSes
- name: Setup Rust toolchain (Other OSes)
if: matrix.os != 'windows-latest'
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --all --no-default-features --features ${{ matrix.feature }}
- uses: actions-rs/cargo@v1
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
with:
command: fmt
args: --all -- --check
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all --no-default-features --features ${{ matrix.feature }} -- --deny warnings