Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: set up github action workflow for rust #114

Merged
merged 8 commits into from Dec 14, 2021
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/cargo-clippy.yml
@@ -0,0 +1,20 @@
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
28 changes: 28 additions & 0 deletions .github/workflows/cargo-cross-build.yml
@@ -0,0 +1,28 @@
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]
PureWhiteWu marked this conversation as resolved.
Show resolved Hide resolved

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 changes: 28 additions & 0 deletions .github/workflows/cargo-test-linux.yml
@@ -0,0 +1,28 @@
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 changes: 28 additions & 0 deletions .github/workflows/cargo-test-macos.yml
@@ -0,0 +1,28 @@
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 changes: 28 additions & 0 deletions .github/workflows/cargo-test-minimum-rust.yml
@@ -0,0 +1,28 @@
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 changes: 28 additions & 0 deletions .github/workflows/cargo-test-windows.yml
@@ -0,0 +1,28 @@
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 }}
27 changes: 27 additions & 0 deletions .github/workflows/test-docker-cgroup.yml
@@ -0,0 +1,27 @@
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
81 changes: 0 additions & 81 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion ci/cgroups/Dockerfile
@@ -1,4 +1,4 @@
FROM rust:1.40
FROM rust:latest

WORKDIR /usr/num_cpus

Expand Down