Skip to content

Commit 3568010

Browse files
committed
Move CI to github actions
1 parent 2fb717d commit 3568010

File tree

3 files changed

+77
-33
lines changed

3 files changed

+77
-33
lines changed

.github/workflows/docs.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches: [master]
6+
tags: ["*"]
7+
pull_request:
8+
# Check all PR
9+
10+
jobs:
11+
build-and-publish:
12+
runs-on: ubuntu-18.04
13+
steps:
14+
- uses: actions/checkout@v2
15+
with:
16+
submodules: true
17+
- name: setup rust
18+
uses: actions-rs/toolchain@v1
19+
with:
20+
profile: minimal
21+
toolchain: stable
22+
- name: build documentation
23+
run: |
24+
cd example
25+
cargo doc --no-deps
26+
- name: put documentation in the website
27+
run: |
28+
git clone https://github.com/$GITHUB_REPOSITORY --branch gh-pages gh-pages
29+
rm -rf gh-pages/.git
30+
cd gh-pages
31+
32+
REF_KIND=$(echo $GITHUB_REF | cut -d / -f2)
33+
if [[ "$REF_KIND" == "tags" ]]; then
34+
TAG=${GITHUB_REF#refs/tags/}
35+
mv ../target/doc/ $TAG
36+
cp ../example/index.html $TAG/index.html
37+
else
38+
rm -rf latest
39+
mv ../target/doc/ latest
40+
cp ../example/index.html latest/index.html
41+
fi
42+
- name: deploy to gh-pages
43+
if: github.event_name == 'push'
44+
uses: peaceiris/actions-gh-pages@v3
45+
with:
46+
github_token: ${{ secrets.GITHUB_TOKEN }}
47+
publish_dir: ./gh-pages/
48+
force_orphan: true

.github/workflows/tests.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
# Check all PR
8+
9+
jobs:
10+
tests:
11+
runs-on: ubuntu-18.04
12+
strategy:
13+
matrix:
14+
rust-version: ["1.31", stable, beta, nightly]
15+
steps:
16+
- uses: actions/checkout@v2
17+
with:
18+
submodules: true
19+
- name: setup rust
20+
uses: actions-rs/toolchain@v1
21+
with:
22+
profile: minimal
23+
toolchain: ${{ matrix.rust-version }}
24+
- name: run tests in debug mode
25+
run: cargo test
26+
- name: run tests in release mode
27+
run: cargo test --release
28+
- name: check that benchmarks still compile
29+
run: cargo bench --no-run

.travis.yml

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

0 commit comments

Comments
 (0)