Prevent CI jobs from running twice on PRs (#220)
1on:
2 pull_request:
3 push:
4 branches:
5 - main
6
7name: Continuous integration
8
9jobs:
10 test-features-none:
11 name: "Test Suite [Features: None]"
12 runs-on: ubuntu-latest
13 steps:
14 - uses: actions/checkout@v3
15 - uses: actions-rs/toolchain@v1
16 with:
17 profile: minimal
18 toolchain: stable
19 override: true
20 - uses: actions-rs/cargo@v1
21 with:
22 command: test
23 args: --no-default-features
24
25 test-features-default:
26 name: "Test Suite [Features: Default]"
27 runs-on: ubuntu-latest
28 steps:
29 - uses: actions/checkout@v3
30 - uses: actions-rs/toolchain@v1
31 with:
32 profile: minimal
33 toolchain: stable
34 override: true
35 - uses: actions-rs/cargo@v1
36 with:
37 command: test
38
39 test-features-alloc:
40 name: "Test Suite [Features: alloc]"
41 runs-on: ubuntu-latest
42 steps:
43 - uses: actions/checkout@v3
44 - uses: actions-rs/toolchain@v1
45 with:
46 profile: minimal
47 toolchain: stable
48 override: true
49 - uses: actions-rs/cargo@v1
50 with:
51 command: test
52 args: --no-default-features --features alloc
53
54 fmt:
55 name: Rustfmt
56 runs-on: ubuntu-latest
57 steps:
58 - uses: actions/checkout@v3
59 - uses: actions-rs/toolchain@v1
60 with:
61 profile: minimal
62 toolchain: stable
63 override: true
64 - run: rustup component add rustfmt
65 - uses: actions-rs/cargo@v1
66 with:
67 command: fmt
68 args: --all -- --check
69
70 clippy:
71 name: Clippy
72 runs-on: ubuntu-latest
73 steps:
74 - uses: actions/checkout@v3
75 - uses: actions-rs/toolchain@v1
76 with:
77 profile: minimal
78 toolchain: nightly
79 override: true
80 - run: rustup component add clippy
81 - uses: actions-rs/cargo@v1
82 with:
83 command: clippy
84 args: -- -D warnings
85
86 markdownlint:
87 name: Markdown Lint
88 runs-on: ubuntu-latest
89 steps:
90 - uses: actions/checkout@v3
91 with:
92 # Full git history is needed to get a proper list of changed files within `super-linter`
93 fetch-depth: 0
94 - name: Run Markdown Lint
95 uses: docker://ghcr.io/github/super-linter:slim-v4
96 env:
97 VALIDATE_ALL_CODEBASE: true
98 VALIDATE_MARKDOWN: true
99 DEFAULT_BRANCH: master