Skip to content

Commit

Permalink
Setup github ci (#47)
Browse files Browse the repository at this point in the history
* Adapted CI configuration from travis to github
  • Loading branch information
rodrimati1992 authored Jan 3, 2021
1 parent 5b941e0 commit ff985dd
Showing 1 changed file with 133 additions and 0 deletions.
133 changes: 133 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
name: Rust

on: [push, pull_request]

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
max-parallel: 2
matrix:
rust: [stable, beta, nightly, 1.41.0]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- uses: actions/checkout@v2
- name: ci-all-versions
run: |
rustup override set ${{ matrix.rust }}
rustup install beta
env CARGO_BUILD_JOBS=1
cd "${{github.workspace}}/examples/0_modules_and_interface_types/impl/"
cargo +beta build
cd "${{github.workspace}}/examples/1_trait_objects/plugin_0/"
cargo +beta build
cd "${{github.workspace}}/examples/1_trait_objects/plugin_1/"
cargo +beta build
cd "${{github.workspace}}/examples/2_nonexhaustive/implementation/"
cargo +beta build
cd "${{github.workspace}}/testing/0/impl_0/"
cargo +beta build
cd "${{github.workspace}}/testing/1 - loading errors/impl_1/"
cargo +beta build
cd "${{github.workspace}}/testing/1 - loading errors/non_abi_stable_lib/"
cargo +beta build
cd "${{github.workspace}}/testing/version_compatibility/impl_0"
cargo +beta build
cd "${{github.workspace}}/"
rm Cargo.lock
cd "${{github.workspace}}/examples/0_modules_and_interface_types/impl/"
cargo check
cd "${{github.workspace}}/examples/1_trait_objects/plugin_0/"
cargo check
cd "${{github.workspace}}/examples/1_trait_objects/plugin_1/"
cargo check
cd "${{github.workspace}}/examples/2_nonexhaustive/implementation/"
cargo check
cd "${{github.workspace}}/testing/0/impl_0/"
cargo check
cd "${{github.workspace}}/testing/1 - loading errors/impl_1/"
cargo check
cd "${{github.workspace}}/testing/1 - loading errors/non_abi_stable_lib/"
cargo check
cd "${{github.workspace}}/abi_stable"
cargo check --no-default-features
cd "${{github.workspace}}/abi_stable_derive"
cargo test
cd "${{github.workspace}}/abi_stable"
cargo test --features "testing sabi_trait_examples"
cd "${{github.workspace}}/examples/0_modules_and_interface_types/impl/"
cargo test
cd "${{github.workspace}}/examples/0_modules_and_interface_types/user/"
cargo run -- run-tests
cd "${{github.workspace}}/examples/1_trait_objects/application/"
cargo run
cd "${{github.workspace}}/examples/2_nonexhaustive/implementation/"
cargo test
cd "${{github.workspace}}/examples/2_nonexhaustive/user/"
cargo run
cd "${{github.workspace}}/testing/0/user_0/"
cargo run
cd "${{github.workspace}}/testing/1 - loading errors/user_1/"
env "RETURN=ok" cargo run
env "RETURN=error" cargo run
env "RETURN=panic" cargo run
cd "${{github.workspace}}/testing/version_compatibility/user_0"
cargo run
- uses: actions/checkout@v2
- name: ci-nighly
if: ${{ matrix.rust == 'nightly' && runner.os == 'Linux' }}
run: |
env CARGO_BUILD_JOBS=1
rustup override set nightly
cd "${{github.workspace}}/abi_stable/"
MIRI_NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)
echo "Installing latest nightly with Miri"
echo "$MIRI_NIGHTLY"
rustup set profile minimal
rustup default "$MIRI_NIGHTLY"
rustup override set "$MIRI_NIGHTLY"
rustup component add miri
cargo miri setup
env "MIRIFLAGS=-Zmiri-disable-isolation" cargo miri test --features testing
cd "${{github.workspace}}"
rm Cargo.lock
cd "${{github.workspace}}/abi_stable/"
cargo clean
cargo update -Z minimal-versions
cd "${{github.workspace}}/abi_stable/"
cargo build

0 comments on commit ff985dd

Please sign in to comment.