Skip to content

Commit 2760333

Browse files
authored
Update rust.yml
1 parent b37c399 commit 2760333

File tree

1 file changed

+52
-9
lines changed

1 file changed

+52
-9
lines changed

.github/workflows/rust.yml

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,62 @@
1-
name: Rust
1+
name: Build
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches:
6+
- "master"
7+
- "develop"
8+
tags:
9+
- "*"
10+
schedule:
11+
- cron: "40 4 * * *" # every day at 4:40
612
pull_request:
7-
branches: [ master ]
813

914
jobs:
10-
build:
15+
test:
16+
name: "Test"
1117

18+
strategy:
19+
matrix:
20+
os: [ubuntu-latest, macos-latest, windows-latest]
21+
22+
runs-on: ${{ matrix.os }}
23+
timeout-minutes: 15
24+
25+
steps:
26+
- name: "Checkout Repository"
27+
uses: actions/checkout@v1
28+
29+
- name: Install Rustup
30+
run: |
31+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly
32+
echo ::add-path::$HOME/.cargo/bin
33+
if: runner.os == 'macOS'
34+
35+
- name: "Print Rust Version"
36+
run: |
37+
rustc -Vv
38+
cargo -Vv
39+
40+
- name: "Run cargo build"
41+
run: cargo build
42+
43+
- name: "Run cargo test"
44+
run: cargo test
45+
46+
check_formatting:
47+
name: "Check Formatting"
1248
runs-on: ubuntu-latest
49+
timeout-minutes: 2
50+
steps:
51+
- uses: actions/checkout@v1
52+
- run: rustup toolchain install nightly --profile minimal --component rustfmt
53+
- run: cargo +nightly fmt -- --check
1354

55+
clippy:
56+
name: "Clippy"
57+
runs-on: ubuntu-latest
58+
timeout-minutes: 10
1459
steps:
15-
- uses: actions/checkout@v2
16-
- name: Build
17-
run: cargo build --verbose
18-
- name: Run tests
19-
run: cargo test --verbose
60+
- uses: actions/checkout@v1
61+
- run: rustup toolchain install nightly --profile minimal --component clippy
62+
- run: cargo +nightly clippy -- -D warnings

0 commit comments

Comments
 (0)