Skip to content

Commit f9b4136

Browse files
authored
ci: merge ci files into 1 (#116)
1 parent ef39d09 commit f9b4136

9 files changed

Lines changed: 166 additions & 233 deletions

‎.appveyor.yml‎

Lines changed: 0 additions & 16 deletions
This file was deleted.

‎.github/workflows/cargo-clippy.yml‎

Lines changed: 0 additions & 20 deletions
This file was deleted.

‎.github/workflows/cargo-cross-build.yml‎

Lines changed: 0 additions & 58 deletions
This file was deleted.

‎.github/workflows/cargo-test-linux.yml‎

Lines changed: 0 additions & 28 deletions
This file was deleted.

‎.github/workflows/cargo-test-macos.yml‎

Lines changed: 0 additions & 28 deletions
This file was deleted.

‎.github/workflows/cargo-test-minimum-rust.yml‎

Lines changed: 0 additions & 28 deletions
This file was deleted.

‎.github/workflows/cargo-test-windows.yml‎

Lines changed: 0 additions & 28 deletions
This file was deleted.

‎.github/workflows/ci.yml‎

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- master
7+
8+
env:
9+
RUST_BACKTRACE: 1
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
ci-pass:
14+
name: CI is green
15+
runs-on: ubuntu-latest
16+
needs:
17+
- msrv
18+
- test-linux
19+
- test-macos
20+
- test-windows
21+
- build-cross
22+
- test-cgroups
23+
steps:
24+
- run: exit 0
25+
26+
msrv:
27+
runs-on: ubuntu-latest
28+
29+
strategy:
30+
matrix:
31+
rust:
32+
- 1.13
33+
target:
34+
- x86_64-unknown-linux-gnu
35+
36+
steps:
37+
- uses: actions/checkout@v2
38+
- name: Run tests
39+
run: |
40+
rustup default ${{ matrix.rust }}
41+
rustup target add ${{ matrix.target }}
42+
cargo test --verbose --target ${{ matrix.target }}
43+
44+
test-linux:
45+
runs-on: ubuntu-latest
46+
47+
strategy:
48+
matrix:
49+
rust:
50+
- stable
51+
- beta
52+
- nightly
53+
target:
54+
- x86_64-unknown-linux-gnu
55+
- x86_64-unknown-linux-musl
56+
57+
steps:
58+
- uses: actions/checkout@v2
59+
- name: Run tests
60+
run: |
61+
rustup default ${{ matrix.rust }}
62+
rustup target add ${{ matrix.target }}
63+
cargo test --verbose --target ${{ matrix.target }}
64+
65+
test-macos:
66+
runs-on: macos-latest
67+
68+
strategy:
69+
matrix:
70+
rust:
71+
- stable
72+
- beta
73+
- nightly
74+
target:
75+
- x86_64-apple-darwin
76+
77+
steps:
78+
- uses: actions/checkout@v2
79+
- name: Run tests
80+
run: |
81+
rustup default ${{ matrix.rust }}
82+
rustup target add ${{ matrix.target }}
83+
cargo test --verbose --target ${{ matrix.target }}
84+
85+
test-windows:
86+
runs-on: windows-latest
87+
88+
strategy:
89+
matrix:
90+
rust:
91+
- stable
92+
- beta
93+
- nightly
94+
target:
95+
- x86_64-pc-windows-gnu
96+
- x86_64-pc-windows-msvc
97+
98+
steps:
99+
- uses: actions/checkout@v2
100+
- name: Run tests
101+
run: |
102+
rustup default ${{ matrix.rust }}
103+
rustup target add ${{ matrix.target }}
104+
cargo test --verbose --target ${{ matrix.target }}
105+
106+
build-cross:
107+
runs-on: ubuntu-latest
108+
109+
strategy:
110+
matrix:
111+
rust:
112+
- stable
113+
target:
114+
- aarch64-unknown-linux-gnu
115+
- i686-pc-windows-gnu
116+
- i686-pc-windows-msvc
117+
- i686-unknown-linux-gnu
118+
- aarch64-apple-darwin
119+
- aarch64-pc-windows-msvc
120+
- aarch64-unknown-linux-musl
121+
- arm-unknown-linux-gnueabi
122+
- arm-unknown-linux-gnueabihf
123+
- armv7-unknown-linux-gnueabihf
124+
- mips-unknown-linux-gnu
125+
- mips64-unknown-linux-gnuabi64
126+
- mips64el-unknown-linux-gnuabi64
127+
- mipsel-unknown-linux-gnu
128+
- powerpc-unknown-linux-gnu
129+
- powerpc64-unknown-linux-gnu
130+
- powerpc64le-unknown-linux-gnu
131+
- riscv64gc-unknown-linux-gnu
132+
- s390x-unknown-linux-gnu
133+
- x86_64-unknown-freebsd
134+
- x86_64-unknown-illumos
135+
- x86_64-unknown-netbsd
136+
- i686-linux-android
137+
- x86_64-linux-android
138+
- arm-linux-androideabi
139+
- aarch64-linux-android
140+
- x86_64-apple-ios
141+
- asmjs-unknown-emscripten
142+
- aarch64-apple-ios
143+
- aarch64-apple-ios-sim
144+
- aarch64-apple-darwin
145+
steps:
146+
- uses: actions/checkout@v2
147+
- name: Run build
148+
run: |
149+
rustup default ${{ matrix.rust }}
150+
rustup target add ${{ matrix.target }}
151+
cargo build --verbose --target ${{ matrix.target }}
152+
153+
test-cgroups:
154+
runs-on: ubuntu-latest
155+
156+
steps:
157+
- uses: actions/checkout@v2
158+
- name: Test Cgroup
159+
run: |
160+
docker build -f ci/cgroups/Dockerfile -t num-cpus-cgroups .
161+
# Test without cgroups
162+
docker run -e NUM_CPUS_TEST_GET=2 num-cpus-cgroups
163+
# Only 1 CPU
164+
docker run --cpus="1" -e NUM_CPUS_TEST_GET=1 num-cpus-cgroups
165+
# 1.5 CPUs
166+
docker run --cpus="1.5" -e NUM_CPUS_TEST_GET=2 num-cpus-cgroups

0 commit comments

Comments
 (0)