MAINT: Migrate CI from travis to github actions

This commit is contained in:
bluss
2020-12-02 00:19:01 +01:00
parent 0cc509e123
commit 818acee100
2 changed files with 85 additions and 55 deletions
+85
View File
@@ -0,0 +1,85 @@
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
name: Continuous integration
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- rust: 1.36.0 # MSRV
features:
- rust: stable
features: serde
- rust: stable
features: rayon
- rust: stable
features: std
- rust: beta
features:
- rust: nightly
bench: 1
- rust: nightly
features: test_low_transition_point
- rust: 1.36.0
target: thumbv6m-none-eabi
features:
- rust: stable
target: thumbv6m-none-eabi
features:
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Add target
run: rustup target add ${{ matrix.target }}
if: matrix.target != ''
- name: Tests (custom target)
if: matrix.target != ''
run: |
cargo build -vv --target=${{ matrix.target }}
cargo build -v -p test-nostd --target=${{ matrix.target }}
- name: Tests
if: matrix.target == ''
run: |
cargo build --verbose --features "${{ matrix.features }}"
cargo doc --verbose --features "${{ matrix.features }}"
cargo test --verbose --features "${{ matrix.features }}"
cargo test --release --verbose --features "${{ matrix.features }}"
- name: Tests (serde)
if: matrix.features == 'serde'
run: |
cargo test --verbose -p test-serde
- name: Test run benchmarks
if: matrix.bench != ''
run: cargo test -v --benches
clippy:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- beta
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: clippy
- run: cargo clippy
-55
View File
@@ -1,55 +0,0 @@
language: rust
sudo: false
matrix:
include:
- rust: 1.36.0
- rust: stable
env:
- FEATURES='serde-1'
- rust: stable
env:
- FEATURES='rayon'
- rust: stable
env:
- FEATURES='std'
- rust: beta
- rust: nightly
env:
- TEST_BENCH=1
- rust: nightly
env:
- FEATURES='test_low_transition_point'
- rust: 1.36.0
env: TARGET=thumbv6m-none-eabi
before_script:
- rustup target add $TARGET
- set -ex
script:
- cargo build -vv --target=$TARGET
- cargo build -v -p test-nostd --target=$TARGET
- rust: stable
env: TARGET=thumbv6m-none-eabi
before_script:
- rustup target add $TARGET
- set -ex
script:
- cargo build -vv --target=$TARGET
- cargo build -v -p test-nostd --target=$TARGET
branches:
only:
- master
script:
- |
cargo build --verbose --features "$FEATURES" &&
if [ -z "$SKIP_TEST" ]; then
cargo test --verbose --features "$FEATURES" &&
cargo test --release --verbose --features "$FEATURES" &&
if [ "$FEATURES" = "serde-1" ]; then
cargo test --verbose -p test-serde &&
cargo test --release --verbose -p test-serde
fi
fi &&
if [ -n "$TEST_BENCH" ]; then
cargo test -v --benches --no-run --features "$FEATURES"
fi &&
cargo doc --verbose --features "$FEATURES"