From 47ae341f05ddd9598b244dc8f5923c39371fabd1 Mon Sep 17 00:00:00 2001 From: MarcoIeni <11428655+MarcoIeni@users.noreply.github.com> Date: Sat, 26 Dec 2020 20:51:10 +0100 Subject: [PATCH] switch to github actions --- .github/bors.toml | 6 +++-- .github/workflows/ci.yml | 46 +++++++++++++++++++++++++++++++++++ .github/workflows/clippy.yml | 21 ++++++++++++++++ .github/workflows/rustfmt.yml | 23 ++++++++++++++++++ .travis.yml | 32 ------------------------ README.md | 2 +- bors.toml | 3 --- ci/install.sh | 12 --------- ci/script.sh | 10 -------- 9 files changed, 95 insertions(+), 60 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/clippy.yml create mode 100644 .github/workflows/rustfmt.yml delete mode 100644 .travis.yml delete mode 100644 bors.toml delete mode 100644 ci/install.sh delete mode 100755 ci/script.sh diff --git a/.github/bors.toml b/.github/bors.toml index 641ba2ea..4714de6e 100644 --- a/.github/bors.toml +++ b/.github/bors.toml @@ -1,7 +1,9 @@ block_labels = ["needs-decision", "S-waiting-on-team"] delete_merged_branches = true required_approvals = 1 +timeout_sec = 14400 status = [ - "continuous-integration/travis-ci/push", + "build (1.36.0)", + "build (stable)", + "test" ] -timeout_sec = 14400 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..7d98728f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,46 @@ +on: + push: + branches: [ staging, trying, master ] + pull_request: + +name: Continuous Integration + +jobs: + # check if the project builds with MSRV, stable and nighly + build: + runs-on: ubuntu-latest + continue-on-error: ${{ matrix.experimental || false }} + strategy: + matrix: + rust: [ 1.36.0, stable ] + include: + # Test nightly but don't fail the build. + - rust: nightly + experimental: true + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + profile: minimal + override: true + - uses: actions-rs/cargo@v1 + with: + command: test + + test: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + - uses: actions-rs/cargo@v1 + with: + command: test diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml new file mode 100644 index 00000000..fe2fc138 --- /dev/null +++ b/.github/workflows/clippy.yml @@ -0,0 +1,21 @@ +on: + push: + branches: [ staging, trying, master ] + pull_request: + +name: Clippy check +jobs: + clippy_check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: 1.36.0 + override: true + components: clippy + # TODO enable this once clippy warnings are fixed + # - uses: actions-rs/clippy-check@v1 + # with: + # token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/rustfmt.yml b/.github/workflows/rustfmt.yml new file mode 100644 index 00000000..9a55c002 --- /dev/null +++ b/.github/workflows/rustfmt.yml @@ -0,0 +1,23 @@ +on: + push: + branches: [ staging, trying, master ] + pull_request: + +name: Code formatting check + +jobs: + fmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: rustfmt + - uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 886aa22f..00000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -dist: trusty -language: rust -services: docker -sudo: required - -rust: - - nightly - - stable - # MSRV - - 1.36.0 - -env: TARGET=x86_64-unknown-linux-gnu - -install: - - sh ci/install.sh - - source ~/.cargo/env || true - -script: - - sh ci/script.sh - -cache: cargo -before_cache: - - chmod -R a+r $HOME/.cargo - -branches: - only: - - staging - - trying - -notifications: - email: - on_success: never diff --git a/README.md b/README.md index 78d6a713..9542e815 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![crates.io](https://img.shields.io/crates/d/svd-parser.svg)](https://crates.io/crates/svd-parser) [![crates.io](https://img.shields.io/crates/v/svd-parser.svg)](https://crates.io/crates/svd-parser) -[![Build Status](https://travis-ci.org/rust-embedded/svd.svg?branch=master)](https://travis-ci.org/rust-embedded/svd) +[![Continuous Integration](https://github.com/rust-embedded/svd/workflows/Continuous%20Integration/badge.svg)](https://github.com/rust-embedded/svd/actions) [![Documentation](https://docs.rs/svd-parser/badge.svg)](https://docs.rs/svd-parser) # `svd-parser` diff --git a/bors.toml b/bors.toml deleted file mode 100644 index 5ccee21e..00000000 --- a/bors.toml +++ /dev/null @@ -1,3 +0,0 @@ -status = [ - "continuous-integration/travis-ci/push", -] \ No newline at end of file diff --git a/ci/install.sh b/ci/install.sh deleted file mode 100644 index 022931f3..00000000 --- a/ci/install.sh +++ /dev/null @@ -1,12 +0,0 @@ -set -ex - -main() { - if [ -x "$(command -v cross)" ]; then - cross -V - else - rustup install stable - cargo +stable install cross - fi -} - -main diff --git a/ci/script.sh b/ci/script.sh deleted file mode 100755 index fdd02019..00000000 --- a/ci/script.sh +++ /dev/null @@ -1,10 +0,0 @@ -set -ex - -main() { - cross build --all-features - cross test --release --all-features -} - -if [ -z $TRAVIS_TAG ]; then - main -fi