Skip to content

Commit

Permalink
Add docker CI
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Apr 1, 2020
1 parent 664d8a1 commit 4109846
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
language: rust
rust: stable
dist: trusty
dist: xenial
sudo: false
notifications:
email: disabled

cache: cargo

Expand Down Expand Up @@ -65,3 +67,13 @@ matrix:
- env: TARGET=x86_64-unknown-netbsd
# Emscripten
- env: TARGET=asmjs-unknown-emscripten

# CGroups in Docker
- name: Docker CGroups
install:
script:
- docker build -f ci/cgroups/Dockerfile -t num-cpus-cgroups .
# Test without cgroups
- docker run -it -e NUM_CPUS_TEST_GET=2 num-cpus-cgroups
# Limit CPUs
- docker run -it --cpus="1" -e NUM_CPUS_TEST_GET=1 num-cpus-cgroups
9 changes: 9 additions & 0 deletions ci/cgroups/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM rust:1.40

WORKDIR /usr/num_cpus

COPY . .

RUN cargo build

CMD [ "cargo", "test", "--lib" ]

0 comments on commit 4109846

Please sign in to comment.