forked from rust-lang/socket2
-
Notifications
You must be signed in to change notification settings - Fork 6
95 lines (91 loc) · 2.92 KB
/
main.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
name: CI
on:
push:
branches: [ master, "v0.3.x" ]
pull_request:
branches: [ master, "v0.3.x" ]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
jobs:
Test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
build: [stable, 1.46.0, beta, nightly, macos, windows]
include:
- build: stable
os: ubuntu-latest
rust: stable
- build: 1.46.0
os: ubuntu-latest
rust: 1.46.0
- build: beta
os: ubuntu-latest
rust: beta
- build: nightly
os: ubuntu-latest
rust: nightly
- build: macos
os: macos-latest
rust: stable
- build: windows
os: windows-latest
rust: stable
steps:
- uses: actions/checkout@master
- name: Install Rust (rustup)
run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
shell: bash
- name: Install cargo-hack
run: cargo install cargo-hack
- name: Run tests
run: cargo hack test --feature-powerset && cargo hack test --feature-powerset --release
Rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust
run: rustup update stable && rustup default stable && rustup component add rustfmt
- name: Check formatting
run: cargo fmt --all -- --check
Check:
name: Check
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# TODO: add the following targets, currently broken.
# "x86_64-unknown-redox"
target: ["aarch64-apple-ios", "aarch64-linux-android", "x86_64-apple-darwin", "x86_64-fuchsia", "x86_64-pc-windows-msvc", "x86_64-pc-solaris", "x86_64-unknown-illumos", "x86_64-unknown-linux-gnu", "x86_64-unknown-netbsd"]
steps:
- uses: actions/checkout@master
- name: Install Rust
run: rustup update stable && rustup default stable
- name: Install cargo-hack
run: cargo install cargo-hack
- name: Install Target
run: rustup target add ${{ matrix.target }}
- name: Run check
run: cargo hack check --feature-powerset --all-targets --examples --bins --tests --target ${{ matrix.target }}
# Redox needs a nightly compiler for libc:
# https://github.com/rust-lang/libc/issues/2012
Check_Redox:
name: Check
runs-on: ubuntu-latest
strategy:
matrix:
target: ["x86_64-unknown-redox"]
steps:
- uses: actions/checkout@master
- name: Install Rust nightly
run: rustup update nightly && rustup default nightly
- name: Install cargo-hack
run: cargo install cargo-hack
- name: Install Target
run: rustup target add ${{ matrix.target }}
- name: Run check
run: cargo hack check --feature-powerset --all-targets --examples --bins --tests --target ${{ matrix.target }}