From 54ab8d847a1a82215dea886480c6790df1ccd5b0 Mon Sep 17 00:00:00 2001 From: Ferran Basora Date: Wed, 21 Jul 2021 14:23:39 +0000 Subject: [PATCH] Replace Travis by Github --- .github/workflows/audit.yml | 14 +++++++++++++ .github/workflows/rust.yml | 39 ++++++++++++++++++++++++++++++++++++- .travis.yml | 22 --------------------- 3 files changed, 52 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/audit.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml new file mode 100644 index 0000000..118008c --- /dev/null +++ b/.github/workflows/audit.yml @@ -0,0 +1,14 @@ +name: Security audit +on: + push: + paths: + - '**/Cargo.toml' + - '**/Cargo.lock' +jobs: + security_audit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/audit-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7eb1343..482261a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,8 +1,45 @@ name: Rust -on: [push] +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +env: + CARGO_TERM_COLOR: always jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Install Tarpaulin + uses: actions-rs/install@v0.1 + with: + crate: cargo-tarpaulin + version: 0.18.0 + use-tool-cache: true + + - uses: actions/checkout@v2 + + - name: Format + run: cargo fmt --all -- --check + + - name: Build + run: cargo build --verbose + + - name: Run tests + run: cargo test --verbose + + - name: Coverage + run: cargo tarpaulin -o Lcov --output-dir ./coverage + + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + build-mac: runs-on: macos-latest diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4eac462..0000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: rust -cache: cargo -dist: trusty -os: - - linux - - osx - -rust: - # FIXME: Try again when component 'rustfmt' is available - # - nightly - - stable - -before_script: - - rustup component add rustfmt - - cargo install --force cargo-audit - - cargo generate-lockfile - -script: - - cargo fmt --all -- --check - - cargo build - - cargo test - - cargo audit