Skip to content

Commit

Permalink
Switch from travis and appveyor to github actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
azriel91 committed Dec 18, 2021
1 parent a89fb39 commit 29d26ca
Show file tree
Hide file tree
Showing 5 changed files with 140 additions and 164 deletions.
132 changes: 132 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
on:
push:
branches:
- master
pull_request:
branches:
- '**'

name: CI

jobs:
audit:
name: Audit
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v1
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

fmt:
name: Rustfmt
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt

- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: clippy

- name: Install Clippy
run: rustup component add clippy

- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

coverage:
name: Coverage
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true

- name: tarpaulin Cache
id: tarpaulin_cache
uses: actions/cache@v2
with:
path: ~/.cargo/bin/cargo-tarpaulin
key: ${{ runner.os }}-cargo-tarpaulin

- uses: actions-rs/cargo@v1
if: steps.tarpaulin_cache.outputs.cache-hit != 'true'
with:
command: install
args: cargo-tarpaulin

- name: 'Run `cargo-tarpaulin`'
uses: actions-rs/cargo@v1
with:
command: tarpaulin
args: --workspace

- name: Upload to codecov.io
uses: codecov/codecov-action@v1
with:
file: ./target/tarpaulin/cobertura.xml

build_and_test_linux:
name: Build and Test (Linux)
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- uses: actions-rs/cargo@v1
with:
command: test
args: --release

build_and_test_windows:
name: Build and Test (Windows)
runs-on: windows-latest
timeout-minutes: 10
steps:
- name: Prepare symlink configuration
run: git config --global core.symlinks true

- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- uses: actions-rs/cargo@v1
with:
command: test
args: --release
41 changes: 0 additions & 41 deletions .travis.yml

This file was deleted.

121 changes: 0 additions & 121 deletions appveyor.yml

This file was deleted.

5 changes: 3 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(missing_debug_implementations, missing_docs)] // kcov-ignore
#![deny(missing_debug_implementations, missing_docs)]
#![no_std]
#![recursion_limit = "128"]

Expand Down Expand Up @@ -167,6 +167,7 @@ const ATTRIBUTES_TO_COPY: &[&str] = &["doc", "cfg", "allow", "deny"];
/// Derives a struct for each enum variant.
///
/// Struct fields including their attributes are copied over.
#[cfg(not(tarpaulin_include))]
#[proc_macro_derive(EnumVariantType, attributes(evt))]
pub fn enum_variant_type(input: TokenStream) -> TokenStream {
let ast = parse_macro_input!(input as DeriveInput);
Expand Down Expand Up @@ -363,7 +364,7 @@ fn data_enum(ast: &DeriveInput) -> &DataEnum {
if let Data::Enum(data_enum) = &ast.data {
data_enum
} else {
panic!("`EnumVariantType` derive can only be used on an enum."); // kcov-ignore
panic!("`EnumVariantType` derive can only be used on an enum.");
}
}

Expand Down
5 changes: 5 additions & 0 deletions tarpaulin.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[default]

[report]
out = ["Html", "Xml"]
output-dir = "target/tarpaulin"

0 comments on commit 29d26ca

Please sign in to comment.