Skip to content

Commit 014368c

Browse files
committed
Migrate CI to Github Actions
1 parent c048b5c commit 014368c

File tree

6 files changed

+218
-173
lines changed

6 files changed

+218
-173
lines changed

.github/workflows/main.yml

Lines changed: 180 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,188 @@
11
name: CI
2-
3-
on: [push]
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- master
49

510
jobs:
6-
build:
11+
style:
12+
name: Check Style
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@master
16+
with:
17+
submodules: true
18+
- name: Install Rust
19+
run: rustup update nightly && rustup default nightly
20+
- run: ci/style.sh
21+
22+
docs:
23+
name: Build Documentation
24+
needs: [style]
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@master
28+
with:
29+
submodules: true
30+
- name: Install Rust
31+
run: rustup update nightly && rustup default nightly
32+
- run: ci/dox.sh
33+
env:
34+
CI: 1
35+
- name: Publish documentation
36+
run: |
37+
cd target/doc
38+
git init
39+
git add .
40+
git -c user.name='ci' -c user.email='ci' commit -m init
41+
git push -f -q https://git:${{ secrets.github_token }}@github.com/${{ github.repository }} HEAD:gh-pages
42+
if: github.event_name == 'push' && github.event.ref == 'refs/heads/master'
743

44+
benches:
45+
name: Build benchmarks
46+
needs: [style]
847
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@master
50+
with:
51+
submodules: true
52+
- name: Install Rust
53+
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
54+
- name: Benchmarks
55+
run: |
56+
cargo test --bench roundtrip
57+
cargo test --features=alloc_trait --bench roundtrip
958
59+
test:
60+
needs: [style]
61+
name: Test
62+
runs-on: ${{ matrix.os }}
63+
strategy:
64+
matrix:
65+
target:
66+
- aarch64-unknown-linux-gnu
67+
- x86_64-apple-darwin
68+
- x86_64-unknown-linux-gnu
69+
include:
70+
# - target: aarch64-linux-android
71+
# os: ubuntu-latest
72+
# rust: nightly
73+
# no_jemalloc_tests: 1
74+
- target: aarch64-unknown-linux-gnu
75+
os: ubuntu-latest
76+
rust: nightly
77+
no_jemalloc_tests: 1
78+
# - target: arm-linux-androideabi
79+
# os: ubuntu-latest
80+
# rust: nightly
81+
# no_jemalloc_tests: 1
82+
# - target: arm-unknown-linux-gnueabi
83+
# os: ubuntu-latest
84+
# rust: nightly
85+
# no_jemalloc_tests: 1
86+
# - target: armv7-unknown-linux-gnueabihf
87+
# os: ubuntu-latest
88+
# rust: nightly
89+
# no_jemalloc_tests: 1
90+
# - target: i586-unknown-linux-gnu
91+
# os: ubuntu-latest
92+
# rust: nightly
93+
# - target: i686-pc-windows-gnu
94+
# os: windows-latest
95+
# rust: nightly
96+
# - target: i686-pc-windows-msvc
97+
# os: windows-latest
98+
# rust: nightly
99+
# - target: i686-unknown-linux-gnu
100+
# os: ubuntu-latest
101+
# rust: nightly
102+
# - target: mips-unknown-linux-gnu
103+
# os: ubuntu-latest
104+
# rust: nightly
105+
# no_jemalloc_tests: 1
106+
# - target: mips64-unknown-linux-gnuabi64
107+
# os: ubuntu-latest
108+
# rust: nightly
109+
# no_jemalloc_tests: 1
110+
# - target: mips64el-unknown-linux-gnuabi64
111+
# os: ubuntu-latest
112+
# rust: nightly
113+
# no_jemalloc_tests: 1
114+
# - target: mipsel-unknown-linux-gnu
115+
# os: ubuntu-latest
116+
# rust: nightly
117+
# no_jemalloc_tests: 1
118+
# - target: s390x-unknown-linux-gnu
119+
# os: ubuntu-latest
120+
# rust: nightly
121+
# no_jemalloc_tests: 1
122+
- target: x86_64-apple-darwin
123+
os: macos-latest
124+
rust: nightly
125+
# - target: x86_64-apple-darwin
126+
# os: macos-latest
127+
# rust: beta
128+
# - target: x86_64-apple-darwin
129+
# os: macos-latest
130+
# rust: stable
131+
# - target: x86_64-linux-android
132+
# os: ubuntu-latest
133+
# rust: nightly
134+
- target: x86_64-unknown-linux-gnu
135+
os: ubuntu-latest
136+
rust: nightly
137+
# - target: x86_64-unknown-linux-gnu
138+
# os: ubuntu-latest
139+
# rust: nightly
140+
# valgrind: 1
141+
- target: x86_64-unknown-linux-gnu
142+
os: ubuntu-latest
143+
rust: nightly
144+
jemalloc-dev: 1
145+
valgrind: 1
146+
# - target: x86_64-unknown-linux-gnu
147+
# os: ubuntu-latest
148+
# rust: beta
149+
- target: x86_64-unknown-linux-gnu
150+
os: ubuntu-latest
151+
rust: stable
152+
10153
steps:
11-
- uses: actions/checkout@v1
12-
- name: Run a one-line script
13-
run: echo Hello, world!
14-
- name: Run a multi-line script
154+
- uses: actions/checkout@master
155+
with:
156+
submodules: true
157+
- name: Install Rust (rustup)
158+
run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
159+
if: matrix.os != 'macos-latest'
160+
- name: Install Rust (macos)
15161
run: |
16-
echo Add other actions to build,
17-
echo test, and deploy your project.
162+
curl https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly
163+
echo "##[add-path]$HOME/.cargo/bin"
164+
if: matrix.os == 'macos-latest'
165+
- run: rustup target add ${{ matrix.target }}
166+
- run: cargo generate-lockfile
167+
168+
# Configure some env vars based on matrix configuration
169+
- run: echo "##[set-env name=NO_JEMALLOC_TESTS]1"
170+
if: matrix.no_jemalloc_tests != ''
171+
- run: echo "##[set-env name=JEMALLOC_SYS_GIT_DEV_BRANCH]1"
172+
if: matrix.jemalloc-dev != ''
173+
- run: echo "##[set-env name=VALGRIND]1"
174+
if: matrix.valgrind != ''
175+
176+
# Windows & OSX go straight to `run.sh` ...
177+
- run: ./ci/run.sh
178+
shell: bash
179+
if: matrix.os != 'ubuntu-latest'
180+
env:
181+
TARGET: ${{ matrix.target }}
182+
183+
# ... while Linux goes to `run-docker.sh`
184+
- run: ./ci/run-docker.sh ${{ matrix.target }}
185+
shell: bash
186+
if: "matrix.os == 'ubuntu-latest'"
187+
env:
188+
TARGET: ${{ matrix.target }}

.travis.yml

Lines changed: 0 additions & 164 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM ubuntu:19.04
2+
RUN apt-get update && apt-get install -y --no-install-recommends \
3+
gcc libc6-dev ca-certificates \
4+
gcc-aarch64-linux-gnu libc6-dev-arm64-cross qemu-user
5+
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
6+
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER="qemu-aarch64 -L /usr/aarch64-linux-gnu" \
7+
PATH=$PATH:/rust/bin
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM ubuntu:19.04
2+
RUN apt-get update
3+
RUN apt-get install -y --no-install-recommends \
4+
gcc libc6-dev ca-certificates valgrind
5+
6+
ENV PATH=$PATH:/rust/bin

ci/dox.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ export RUSTDOCFLAGS="--cfg jemallocator_docs"
66
cargo doc --features alloc_trait
77
cargo doc -p jemalloc-sys
88
cargo doc -p jemalloc-ctl
9+
cargo doc -p jemallocator-global

0 commit comments

Comments
 (0)