Repository: evansmurithi/cloak (language: rust)

Issue:
Migrate to github actions



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..8328675
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,138 @@
+name: CI
+
+on:
+  push:
+    branches:
+      - master
+  pull_request:
+    branches:
+      - '*'
+
+jobs:
+  ci:
+    name: CI
+    needs:
+      - test
+      - lint
+    runs-on: ubuntu-latest
+    steps:
+      - name: Done
+        run: exit 0
+  prepare:
+    name: Prepare
+    runs-on: ubuntu-latest
+    steps:
+      - uses: fkirc/skip-duplicate-actions@master
+        with:
+          github_token: ${{ secrets.GITHUB_TOKEN }}
+  test:
+    name: Tests
+    needs:
+      - prepare
+    strategy:
+      fail-fast: false
+      matrix:
+        rust:
+          - 1.46.0
+          - stable
+        os:
+          - windows-latest
+          - macos-latest
+          - ubuntu-latest
+        target:
+          - i686-pc-windows-msvc
+          - x86_64-pc-windows-msvc
+          - x86_64-unknown-linux-gnu
+          - i686-unknown-linux-gnu
+          - x86_64-apple-darwin
+        exclude:
+          - os: windows-latest
+            target: x86_64-apple-darwin
+          - os: windows-latest
+            target: x86_64-unknown-linux-gnu
+          - os: windows-latest
+            target: i686-unknown-linux-gnu
+          - os: macos-latest
+            target: i686-pc-windows-msvc
+          - os: macos-latest
+            target: x86_64-pc-windows-msvc
+          - os: macos-latest
+            target: x86_64-unknown-linux-gnu
+          - os: macos-latest
+            target: i686-unknown-linux-gnu
+          - os: ubuntu-latest
+            target: i686-pc-windows-msvc
+          - os: ubuntu-latest
+            target: x86_64-pc-windows-msvc
+          - os: ubuntu-latest
+            target: x86_64-apple-darwin
+    runs-on: ${{ matrix.os }}
+    steps:
+      - name: Install rust
+        uses: actions-rs/toolchain@v1
+        with:
+          profile: minimal
+          toolchain: ${{ matrix.rust }}
+          target: ${{ matrix.target }}
+          override: true
+      - name: Checkout
+        uses: actions/checkout@v2
+      - name: Install linker
+        if: matrix.target == 'i686-unknown-linux-gnu'
+        run: |
+          sudo apt-get update
+          sudo apt-get install gcc-5-multilib lib32gcc-5-dev
+      - name: Test
+        uses: actions-rs/cargo@v1
+        with:
+          command: test
+          args: --target ${{ matrix.target }}
+  lint:
+    name: Linting (fmt + clippy)
+    needs:
+      - prepare
+    runs-on: ubuntu-latest
+    steps:
+      - name: Install rust
+        uses: actions-rs/toolchain@v1
+        with:
+          profile: minimal
+          toolchain: stable
+          override: true
+          components: rustfmt, clippy
+      - name: Checkout
+        uses: actions/checkout@v2
+      - name: Clippy
+        uses: actions-rs/cargo@v1
+        with:
+          command: clippy
+          args: --all-targets --all-features -- -D warnings
+      - name: Format check
+        uses: actions-rs/cargo@v1
+        with:
+          command: fmt
+          args: --all -- --check
+  coverage:
+    name: Coverage
+    needs:
+      - prepare
+    continue-on-error: true
+    runs-on: ubuntu-latest
+    steps:
+      - name: Install rust
+        uses: actions-rs/toolchain@v1
+        with:
+          toolchain: stable
+          override: true
+      - name: Checkout
+        uses: actions/checkout@v2
+        with:
+          fetch-depth: 0
+      - name: Coverage
+        uses: actions-rs/tarpaulin@v0.1
+        with:
+          args: --timeout 300 --output-dir coverage
+      - name: Codecov
+        uses: codecov/codecov-action@v1
+        with:
+          directory: coverage
diff --git a/.github/workflows/security-audit.yml b/.github/workflows/security-audit.yml
new file mode 100644
index 0000000..b828d98
--- /dev/null
+++ b/.github/workflows/security-audit.yml
@@ -0,0 +1,21 @@
+name: Security audit
+
+on:
+  push:
+    paths:
+      - '**/Cargo.toml'
+      - '**/Cargo.lock'
+  schedule:
+    - cron: '0 0 * * *'
+
+jobs:
+  audit:
+    name: Security audit
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v2
+      - name: Audit check
+        uses: actions-rs/audit-check@v1
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index aafd5e2..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,120 +0,0 @@
-language: rust
-
-matrix:
-  include:
-    # Stable channel.
-    - os: linux
-      rust: stable
-      env: TARGET=x86_64-unknown-linux-gnu
-    - os: linux
-      rust: stable
-      env:
-        - TARGET=x86_64-unknown-linux-musl
-        - CC_x86_64_unknown_linux_musl=/usr/bin/musl-gcc
-    - os: linux
-      rust: stable
-      env: TARGET=i686-unknown-linux-gnu
-    - os: osx
-      rust: stable
-      env: TARGET=x86_64-apple-darwin
-    - os: linux
-      rust: stable
-      env:
-        - TARGET=arm-unknown-linux-gnueabihf
-        - CC_arm_unknown_linux_gnueabihf=/usr/bin/arm-linux-gnueabihf-gcc-4.8
-        - CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc-4.8
-    - os: linux
-      rust: stable
-      env:
-        - TARGET=aarch64-unknown-linux-gnu
-        - CC_aarch64-unknown-linux-gnu=/usr/bin/aarch64-linux-gnu-gcc-4.8
-        - CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc-4.8
-
-    # Minimum Rust supported channel.
-    - os: linux
-      rust: 1.46.0
-      env: TARGET=x86_64-unknown-linux-gnu
-    - os: linux
-      rust: 1.46.0
-      env:
-        - TARGET=x86_64-unknown-linux-musl
-        - CC_x86_64_unknown_linux_musl=/usr/bin/musl-gcc
-    - os: osx
-      rust: 1.46.0
-      env: TARGET=x86_64-apple-darwin
-
-    # Code formatting and linting check
-    - os: linux
-      rust: stable
-      # skip the global install step
-      install:
-        - rustup component add rustfmt
-        - rustup component add clippy
-      script:
-        - cargo fmt --all -- --check
-        - cargo clippy --all-targets --all-features -- -D warnings
-
-sudo: required
-
-before_install:
-  - bash ci/before_install.bash
-
-env:
-  global:
-    # Default target on travis-ci.
-    # Used as conditional check in the install stage
-    - HOST=x86_64-unknown-linux-gnu
-    # Used on the deployment script
-    - PROJECT_NAME=cloak
-
-install:
-  # prevent target re-add error from rustup
-  - if [[ $TRAVIS_OS_NAME = linux && $HOST != $TARGET ]]; then rustup target add $TARGET; fi
-
-script:
-  - bash ci/script.bash
-
-before_deploy:
-  - bash ci/before_deploy.bash
-
-deploy:
-  provider: releases
-  # NOTE updating the `api_key.secure`
-  # - go to: https://github.com/settings/tokens/new
-  # - generate new token using `public_repo` scope
-  # - encrypt it using: `travis encrypt API_KEY_HERE`
-  # - paste the output below
-  api_key:
-    secure: XMRJ/QF+//ozfLCQ6ux2UCy8BFGm0hxPkV1Fh07eGur0Y9dHgDwYlZU//PrG7iRUUkuRBD3aOHEmHEO6EYs8jMCeP/CHKWxXejPIeXW/WlltQmrJsnxAz4BDn+vzM+N0dhYWuiEchR1XOn4AaP6fUTzovybk1fFHpblh75MYh1ph+hQhiU/8yY5ZjVi0oLJ8IomZNRJiRPUozYH2kl+zpn6aHvm8c8iEUZpJ1oT6JTiLH0yzpYUuHkJmgCKK0K2Kd+vQ3Tv10YQ1g77ybLol+xdqeStGjn2qImzZCu0vLHY+zNaTsqF4uXCwvz8wQ/4mDjG2+03nE7LSFcbQFlvcPZ5bR3nTkKmzUp6+ERhseVuj/vMZ4hqsfYJiW3DHys7YzfblBLFNdBXhxm3aEuoqh1aLqT5XR6kHZV3kZ3T0dg1bMxWS24OKB7iU5GNZJxPVpWOSeCYODtx7MxPUF+eLZvY3s0mdrCIYcdz5b89N9qT+s5W63lEaTaKFNLHEd62hICxmGDfrD/S7Q1HMFl9zj7jkZi3LzbR+hO++qXKPORizoee0hPzbuE1Mwn+f5tMgaB3G+LPyakdV5/je9F2WfKBBy/WhSjxytP2Kj4ABeq88lNSmdpZSFoesO9iNHZcNudwzif82iMeuGoIaxGMnXh4kDQ6otpFmo9Lg8w8sHVM=
-  # for uploading multiple files
-  file_glob: true
-  # NOTE explanation on each env variable
-  # - PROJECT_NAME: name of the project, set on the `env.global` above
-  # - TRAVIS_TAG: tag name that the build is being deployed for, usually the version number
-  # - TARGET: target triple of the build
-  file:
-    - $PROJECT_NAME-$TRAVIS_TAG-$TARGET.*
-    - $PROJECT_NAME*.deb
-  # don't delete artifacts from previous stage
-  skip_cleanup: true
-  on:
-    # deploy only if we push a tag
-    tags: true
-    # deploy only on stable channel that has TARGET env variable sets
-    condition: $TRAVIS_RUST_VERSION = stable && $TARGET != ""
-
-branches:
-  only:
-    - "/^v\\d+\\.\\d+\\.\\d+.*$/"
-    - master
-
-notifications:
-  email:
-    on_success: never
-
-# Caching
-cache:
-  directories:
-    - /home/travis/.cargo
-before_cache:
-  - rm -rf /home/travis/.cargo/registry
diff --git a/README.md b/README.md
index 55f1b70..70a87ca 100644
--- a/README.md
+++ b/README.md
@@ -3,8 +3,8 @@
 A Command Line OTP (One Time Password) Authenticator application written in Rust that generates
 time-based and counter-based OTP codes.
 
-[![Linux build status](https://travis-ci.com/evansmurithi/cloak.svg?branch=master)](https://travis-ci.com/evansmurithi/cloak)
-[![Windows build status](https://ci.appveyor.com/api/projects/status/9mlfpfru3ng4c689?svg=true)](https://ci.appveyor.com/project/evansmurithi/cloak)
+![CI](https://github.com/evansmurithi/cloak/workflows/CI/badge.svg)
+[![codecov](https://codecov.io/gh/evansmurithi/cloak/branch/master/graph/badge.svg?token=Y72C1MM1E8)](https://codecov.io/gh/evansmurithi/cloak)
 ![License](https://img.shields.io/crates/l/cloak.svg)
 [![Crates.io version](https://img.shields.io/crates/v/cloak.svg)](https://crates.io/crates/cloak)
 
diff --git a/appveyor.yml b/appveyor.yml
deleted file mode 100644
index ddbf4b7..0000000
--- a/appveyor.yml
+++ /dev/null
@@ -1,65 +0,0 @@
-environment:
-  global:
-    RUST_VERSION: stable
-    CRATE_NAME: cloak
-    CARGO_HOME: "c:\\cargo"
-    RUSTUP_HOME: "c:\\rustup"
-
-  matrix:
-    - TARGET: x86_64-pc-windows-msvc
-    - TARGET: i686-pc-windows-msvc
-
-# Install Rust and Cargo
-install:
-  - ps: >-
-      If ($Env:TARGET -eq 'x86_64-pc-windows-gnu') {
-        $Env:PATH += ';C:\msys64\mingw64\bin'
-      } ElseIf ($Env:TARGET -eq 'i686-pc-windows-gnu') {
-        $Env:PATH += ';C:\msys64\mingw32\bin'
-      }
-  - appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
-  - rustup-init.exe -y --default-host %TARGET% --default-toolchain %RUST_VERSION%
-  - set PATH=%PATH%;C:\cargo\bin
-  - rustc -Vv
-  - cargo -V
-
-# Building is done in the test phase, so we disable Appveyor's build phase.
-build: false
-
-# Equivalent to Travis' `script` phase
-test_script:
-  - cargo test --target %TARGET% --verbose
-  - cargo run --target %TARGET% -- view test_app
-
-before_deploy:
-  # Generate artifacts for release
-  - cargo build --release --verbose
-  - ps: ci\before_deploy.ps1
-
-deploy:
-  description: 'Windows release'
-  artifact: /.*\.zip/
-  # Here's how:
-  # - Go to 'https://github.com/settings/tokens/new' and generate a Token with only the
-  # `public_repo` scope enabled
-  # - Then go to 'https://ci.appveyor.com/tools/encrypt' and enter the newly generated token.
-  # - Enter the "encrypted value" below
-  auth_token:
-    secure: chvt6Gw6dTdrWFr5c1qFmCdylM8Qbk9VDEO4Z5zu/cNg9EhCHYtG98BEIB9WgFxx
-  provider: GitHub
-  on:
-    RUST_VERSION: stable
-    appveyor_repo_tag: true
-
-cache:
-  - C:\Users\appveyor\.cargo\registry
-  - target
-
-branches:
-  only:
-    - "/^v\\d+\\.\\d+\\.\\d+.*$/"
-    - master
-
-notifications:
-  - provider: Email
-    on_build_success: false
diff --git a/codecov.yml b/codecov.yml
new file mode 100644
index 0000000..7f10bcb
--- /dev/null
+++ b/codecov.yml
@@ -0,0 +1,2 @@
+ignore:
+  - tests


Test patch: