Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Changing to github actions (#35)
* Change to Github Action. * Adding cache.
- Loading branch information
Showing
with
85 additions
and 140 deletions.
- +85 −0 .github/workflows/rust.yml
- +0 −71 .travis.yml
- +0 −69 scripts/ci.sh
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,85 @@ | ||
name: CI | ||
Check warning on line 1 in .github/workflows/rust.yml
|
||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
pull_request: | ||
branches: | ||
- master | ||
- develop | ||
|
||
jobs: | ||
Lint: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: False | ||
steps: | ||
- name: Download commit | ||
uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 1 | ||
- name: Cache cargo | ||
id: cache-cargo | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.cargo/ | ||
key: ${{ runner.os }}-lint-cargo | ||
- name: Install latest nightly | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
- name: Lint | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
toolchain: nightly | ||
command: fmt | ||
args: --all -- --check | ||
Build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: False | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
# To enable windows build delete the line above and this one then uncoment the one under | ||
#os: [ubuntu-latest, macos-latest, windows-latest] | ||
# The "" is just debug | ||
release: ["", "--release"] | ||
steps: | ||
- name: Download commit | ||
uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 1 | ||
- name: Cache cargo | ||
id: cache-cargo | ||
uses: actions/cache@v1 | ||
with: | ||
path: .cargo/ | ||
key: ${{ runner.os }}-${{ matrix.release }}-cargo | ||
- name: Install latest nightly | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
- name: Build | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
toolchain: nightly | ||
command: build | ||
args: ${{ matrix.release }} --all | ||
- name: Test | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
toolchain: nightly | ||
command: test | ||
args: ${{ matrix.release }} --all | ||
env: | ||
RUST_TEST_THREADS: 1 | ||
- name: Prepare uploads | ||
shell: bash | ||
run: mkdir bins/ && for i in $(ls target/{debug,release}/{libsvm_runtime_c_api.{so,dylib,dll},svm_wasmer.h}); do mv $i bins/; done | ||
- name: Upload bins | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: bins-${{ runner.os }}${{ matrix.release }} | ||
path: bins/ |