forked from camino-rs/camino
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (72 loc) · 1.96 KB
/
ci.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
on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
name: CI
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v2
with:
# By default actions/checkout checks out a merge commit. This makes no sense whatsoever.
# https://github.com/actions/checkout#checkout-pull-request-head-commit-instead-of-merge-commit
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- name: Lint (clippy)
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-features --all-targets
- name: Lint (rustfmt)
uses: actions-rs/cargo@v1
with:
command: xfmt
args: --check
- name: Check for differences
run: git diff --exit-code
build:
name: Build and test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
# 1.34 is the MSRV, and the other versions add new features through build.rs.
rust-version: [ 1.34, 1.44, stable ]
fail-fast: false
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust-version }}
override: true
- name: Build the library
uses: actions-rs/cargo@v1
with:
command: build
- name: Build all targets with all features
uses: actions-rs/cargo@v1
with:
command: build
args: --all-targets --all-features
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features