mirror of
https://gitee.com/openharmony/third_party_rust_num_cpus
synced 2024-11-23 05:29:41 +00:00
ci: merge ci files into 1 (#116)
This commit is contained in:
parent
ef39d0912d
commit
f9b41366dc
@ -1,16 +0,0 @@
|
||||
environment:
|
||||
matrix:
|
||||
- TARGET: x86_64-pc-windows-msvc
|
||||
- TARGET: i686-pc-windows-msvc
|
||||
- TARGET: x86_64-pc-windows-gnu
|
||||
- TARGET: i686-pc-windows-gnu
|
||||
install:
|
||||
- curl -sSf -o rustup-init.exe https://win.rustup.rs/
|
||||
- rustup-init.exe -y --default-host %TARGET%
|
||||
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
|
||||
- rustc -vV
|
||||
- cargo -vV
|
||||
build: false
|
||||
test_script:
|
||||
- cargo build --verbose
|
||||
- cargo test --verbose
|
20
.github/workflows/cargo-clippy.yml
vendored
20
.github/workflows/cargo-clippy.yml
vendored
@ -1,20 +0,0 @@
|
||||
name: Cargo Clippy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Make clippy happy
|
||||
run: cargo clippy
|
58
.github/workflows/cargo-cross-build.yml
vendored
58
.github/workflows/cargo-cross-build.yml
vendored
@ -1,58 +0,0 @@
|
||||
name: Cargo Cross Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
rust: [stable]
|
||||
target:
|
||||
- aarch64-unknown-linux-gnu
|
||||
- i686-pc-windows-gnu
|
||||
- i686-pc-windows-msvc
|
||||
- i686-unknown-linux-gnu
|
||||
- aarch64-apple-darwin
|
||||
- aarch64-pc-windows-msvc
|
||||
- aarch64-unknown-linux-musl
|
||||
- arm-unknown-linux-gnueabi
|
||||
- arm-unknown-linux-gnueabihf
|
||||
- armv7-unknown-linux-gnueabihf
|
||||
- mips-unknown-linux-gnu
|
||||
- mips64-unknown-linux-gnuabi64
|
||||
- mips64el-unknown-linux-gnuabi64
|
||||
- mipsel-unknown-linux-gnu
|
||||
- powerpc-unknown-linux-gnu
|
||||
- powerpc64-unknown-linux-gnu
|
||||
- powerpc64le-unknown-linux-gnu
|
||||
- riscv64gc-unknown-linux-gnu
|
||||
- s390x-unknown-linux-gnu
|
||||
- x86_64-unknown-freebsd
|
||||
- x86_64-unknown-illumos
|
||||
- x86_64-unknown-netbsd
|
||||
- i686-linux-android
|
||||
- x86_64-linux-android
|
||||
- arm-linux-androideabi
|
||||
- aarch64-linux-android
|
||||
- x86_64-apple-ios
|
||||
- asmjs-unknown-emscripten
|
||||
- aarch64-apple-ios
|
||||
- aarch64-apple-ios-sim
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run build
|
||||
run: |
|
||||
rustup default ${{ matrix.rust }}
|
||||
rustup target add ${{ matrix.target }}
|
||||
cargo build --verbose --target ${{ matrix.target }}
|
28
.github/workflows/cargo-test-linux.yml
vendored
28
.github/workflows/cargo-test-linux.yml
vendored
@ -1,28 +0,0 @@
|
||||
name: Cargo Test Linux
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
rust: [stable, beta, nightly]
|
||||
target: [x86_64-unknown-linux-gnu, x86_64-unknown-linux-musl]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run tests
|
||||
run: |
|
||||
rustup default ${{ matrix.rust }}
|
||||
rustup target add ${{ matrix.target }}
|
||||
cargo test --verbose --target ${{ matrix.target }}
|
28
.github/workflows/cargo-test-macos.yml
vendored
28
.github/workflows/cargo-test-macos.yml
vendored
@ -1,28 +0,0 @@
|
||||
name: Cargo Test macOS
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: macos-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
rust: [stable, beta, nightly]
|
||||
target: [x86_64-apple-darwin, x86_64-apple-ios, aarch64-apple-darwin]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run tests
|
||||
run: |
|
||||
rustup default ${{ martix.rust }}
|
||||
rustup target add ${{ matrix.target }}
|
||||
cargo test --verbose --target ${{ matrix.target }}
|
28
.github/workflows/cargo-test-minimum-rust.yml
vendored
28
.github/workflows/cargo-test-minimum-rust.yml
vendored
@ -1,28 +0,0 @@
|
||||
name: Cargo Test Minimum Rust Version
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
rust: [1.13]
|
||||
target: [x86_64-unknown-linux-gnu]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run tests
|
||||
run: |
|
||||
rustup default ${{ matrix.rust }}
|
||||
rustup target add ${{ matrix.target }}
|
||||
cargo test --verbose --target ${{ matrix.target }}
|
28
.github/workflows/cargo-test-windows.yml
vendored
28
.github/workflows/cargo-test-windows.yml
vendored
@ -1,28 +0,0 @@
|
||||
name: Cargo Test Windows
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: windows-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
rust: [stable, beta, nightly]
|
||||
target: [x86_64-pc-windows-gnu, x86_64-pc-windows-msvc]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run tests
|
||||
run: |
|
||||
rustup default ${{ matrix.rust }}
|
||||
rustup target add ${{ matrix.target }}
|
||||
cargo test --verbose --target ${{ matrix.target }}
|
166
.github/workflows/ci.yml
vendored
Normal file
166
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,166 @@
|
||||
name: CI
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
ci-pass:
|
||||
name: CI is green
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- msrv
|
||||
- test-linux
|
||||
- test-macos
|
||||
- test-windows
|
||||
- build-cross
|
||||
- test-cgroups
|
||||
steps:
|
||||
- run: exit 0
|
||||
|
||||
msrv:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
rust:
|
||||
- 1.13
|
||||
target:
|
||||
- x86_64-unknown-linux-gnu
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run tests
|
||||
run: |
|
||||
rustup default ${{ matrix.rust }}
|
||||
rustup target add ${{ matrix.target }}
|
||||
cargo test --verbose --target ${{ matrix.target }}
|
||||
|
||||
test-linux:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
rust:
|
||||
- stable
|
||||
- beta
|
||||
- nightly
|
||||
target:
|
||||
- x86_64-unknown-linux-gnu
|
||||
- x86_64-unknown-linux-musl
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run tests
|
||||
run: |
|
||||
rustup default ${{ matrix.rust }}
|
||||
rustup target add ${{ matrix.target }}
|
||||
cargo test --verbose --target ${{ matrix.target }}
|
||||
|
||||
test-macos:
|
||||
runs-on: macos-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
rust:
|
||||
- stable
|
||||
- beta
|
||||
- nightly
|
||||
target:
|
||||
- x86_64-apple-darwin
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run tests
|
||||
run: |
|
||||
rustup default ${{ matrix.rust }}
|
||||
rustup target add ${{ matrix.target }}
|
||||
cargo test --verbose --target ${{ matrix.target }}
|
||||
|
||||
test-windows:
|
||||
runs-on: windows-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
rust:
|
||||
- stable
|
||||
- beta
|
||||
- nightly
|
||||
target:
|
||||
- x86_64-pc-windows-gnu
|
||||
- x86_64-pc-windows-msvc
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run tests
|
||||
run: |
|
||||
rustup default ${{ matrix.rust }}
|
||||
rustup target add ${{ matrix.target }}
|
||||
cargo test --verbose --target ${{ matrix.target }}
|
||||
|
||||
build-cross:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
rust:
|
||||
- stable
|
||||
target:
|
||||
- aarch64-unknown-linux-gnu
|
||||
- i686-pc-windows-gnu
|
||||
- i686-pc-windows-msvc
|
||||
- i686-unknown-linux-gnu
|
||||
- aarch64-apple-darwin
|
||||
- aarch64-pc-windows-msvc
|
||||
- aarch64-unknown-linux-musl
|
||||
- arm-unknown-linux-gnueabi
|
||||
- arm-unknown-linux-gnueabihf
|
||||
- armv7-unknown-linux-gnueabihf
|
||||
- mips-unknown-linux-gnu
|
||||
- mips64-unknown-linux-gnuabi64
|
||||
- mips64el-unknown-linux-gnuabi64
|
||||
- mipsel-unknown-linux-gnu
|
||||
- powerpc-unknown-linux-gnu
|
||||
- powerpc64-unknown-linux-gnu
|
||||
- powerpc64le-unknown-linux-gnu
|
||||
- riscv64gc-unknown-linux-gnu
|
||||
- s390x-unknown-linux-gnu
|
||||
- x86_64-unknown-freebsd
|
||||
- x86_64-unknown-illumos
|
||||
- x86_64-unknown-netbsd
|
||||
- i686-linux-android
|
||||
- x86_64-linux-android
|
||||
- arm-linux-androideabi
|
||||
- aarch64-linux-android
|
||||
- x86_64-apple-ios
|
||||
- asmjs-unknown-emscripten
|
||||
- aarch64-apple-ios
|
||||
- aarch64-apple-ios-sim
|
||||
- aarch64-apple-darwin
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run build
|
||||
run: |
|
||||
rustup default ${{ matrix.rust }}
|
||||
rustup target add ${{ matrix.target }}
|
||||
cargo build --verbose --target ${{ matrix.target }}
|
||||
|
||||
test-cgroups:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Test Cgroup
|
||||
run: |
|
||||
docker build -f ci/cgroups/Dockerfile -t num-cpus-cgroups .
|
||||
# Test without cgroups
|
||||
docker run -e NUM_CPUS_TEST_GET=2 num-cpus-cgroups
|
||||
# Only 1 CPU
|
||||
docker run --cpus="1" -e NUM_CPUS_TEST_GET=1 num-cpus-cgroups
|
||||
# 1.5 CPUs
|
||||
docker run --cpus="1.5" -e NUM_CPUS_TEST_GET=2 num-cpus-cgroups
|
27
.github/workflows/test-docker-cgroup.yml
vendored
27
.github/workflows/test-docker-cgroup.yml
vendored
@ -1,27 +0,0 @@
|
||||
name: Test Docker Cgroup
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Test Cgroup
|
||||
run: |
|
||||
docker build -f ci/cgroups/Dockerfile -t num-cpus-cgroups .
|
||||
# Test without cgroups
|
||||
docker run -e NUM_CPUS_TEST_GET=2 num-cpus-cgroups
|
||||
# Only 1 CPU
|
||||
docker run --cpus="1" -e NUM_CPUS_TEST_GET=1 num-cpus-cgroups
|
||||
# 1.5 CPUs
|
||||
docker run --cpus="1.5" -e NUM_CPUS_TEST_GET=2 num-cpus-cgroups
|
Loading…
Reference in New Issue
Block a user