From 29042a6af258ca13641a594e5b41dabcd5b2d63f Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sat, 15 May 2021 20:45:41 +0200 Subject: [PATCH] enable GitHub Actions --- .github/workflows/ci.yml | 74 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 60 -------------------------------- ci/install.sh | 22 ------------ ci/script.sh | 20 ----------- 4 files changed, 74 insertions(+), 102 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml delete mode 100644 ci/install.sh delete mode 100644 ci/script.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0ee1c07 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,74 @@ +on: + push: + branches: [master] + pull_request: + branches: [master] + +name: Continuous integration + +jobs: + test : + name: Test Suite + strategy: + matrix: + target: + # Linux + - x86_64-unknown-linux-gnu + - aarch64-unknown-linux-gnu + - armv7-unknown-linux-gnueabihf + - i686-unknown-linux-gnu + - mips-unknown-linux-gnu + - mips64-unknown-linux-gnuabi64 + - mips64el-unknown-linux-gnuabi64 + - mipsel-unknown-linux-gnu + - powerpc-unknown-linux-gnu + - powerpc64-unknown-linux-gnu + - powerpc64le-unknown-linux-gnu + + # *BSD + - x86_64-unknown-freebsd + os: + - ubuntu-latest + + include: + # macOS + - target: x86_64-apple-darwin + os: macOS-latest + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + target: ${{ matrix.target }} + override: true + + # omit tests + - uses: actions-rs/cargo@v1 + if: matrix.target == '*bsd*' + with: + use-cross: true + command: check + args: --target ${{ matrix.target }} + + - uses: actions-rs/cargo@v1 + if: matrix.target != '*bsd*' + with: + use-cross: true + command: test + args: --target ${{ matrix.target }} + - uses: actions-rs/cargo@v1 + if: matrix.target != '*bsd*' + with: + use-cross: true + command: run + args: --target ${{ matrix.target }} --release --example hello + - uses: actions-rs/cargo@v1 + if: matrix.target != '*bsd*' + with: + use-cross: true + command: test + args: --target ${{ matrix.target }} --release diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 96cef03..0000000 --- a/.travis.yml +++ /dev/null @@ -1,60 +0,0 @@ -dist: trusty -language: rust -services: docker -sudo: required - -rust: nightly - -env: TARGET=x86_64-unknown-linux-gnu -matrix: - include: - # Linux - - env: TARGET=i686-unknown-linux-gnu - # - env: TARGET=x86_64-unknown-linux-gnu # this is the default job - - # OSX - # - env: TARGET=i686-apple-darwin - # os: osx - - env: TARGET=x86_64-apple-darwin - os: osx - - # *BSD - # - env: TARGET=i686-unknown-freebsd DISABLE_TESTS=1 - - env: TARGET=x86_64-unknown-freebsd DISABLE_TESTS=1 - # - env: TARGET=x86_64-unknown-netbsd DISABLE_TESTS=1 - - # Other architectures - - env: TARGET=aarch64-unknown-linux-gnu - - env: TARGET=armv7-unknown-linux-gnueabihf - - env: TARGET=mips-unknown-linux-gnu - - env: TARGET=mips64-unknown-linux-gnuabi64 - - env: TARGET=mips64el-unknown-linux-gnuabi64 - - env: TARGET=mipsel-unknown-linux-gnu - - env: TARGET=powerpc-unknown-linux-gnu - - env: TARGET=powerpc64-unknown-linux-gnu - - env: TARGET=powerpc64le-unknown-linux-gnu - # - env: TARGET=s390x-unknown-linux-gnu DISABLE_TESTS=1 - -before_install: set -e - -install: - - sh ci/install.sh - - source ~/.cargo/env || true - -script: - - bash ci/script.sh - -after_script: set +e - -cache: cargo -before_cache: - - chmod -R a+r $HOME/.cargo - -branches: - only: - - auto - - try - -notifications: - email: - on_success: never diff --git a/ci/install.sh b/ci/install.sh deleted file mode 100644 index 0b7fe27..0000000 --- a/ci/install.sh +++ /dev/null @@ -1,22 +0,0 @@ -set -ex - -main() { - curl https://sh.rustup.rs -sSf | \ - sh -s -- -y --default-toolchain $TRAVIS_RUST_VERSION - - local target= - if [ $TRAVIS_OS_NAME = linux ]; then - target=x86_64-unknown-linux-gnu - else - target=x86_64-apple-darwin - fi - - curl -LSfs https://japaric.github.io/trust/install.sh | \ - sh -s -- \ - --force \ - --git japaric/cross \ - --tag v0.1.4 \ - --target $target -} - -main diff --git a/ci/script.sh b/ci/script.sh deleted file mode 100644 index dbdeeb4..0000000 --- a/ci/script.sh +++ /dev/null @@ -1,20 +0,0 @@ -set -ex - -main() { - cross build --target $TARGET - cross build --target $TARGET --release - - if [ ! -z $DISABLE_TESTS ]; then - return - fi - - cross test --target $TARGET - cross test --target $TARGET --release - - cross run --target $TARGET --example hello - cross run --target $TARGET --release --example hello -} - -if [ -z $TRAVIS_TAG ]; then - main -fi