Skip to content

Commit

Permalink
Use GitHub Actions for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sile committed Sep 10, 2020
1 parent 96e6208 commit ae1efc3
Show file tree
Hide file tree
Showing 5 changed files with 139 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/actions-rs/grcov.yml
@@ -0,0 +1,3 @@
ignore-not-existing: true
ignore:
- "../*"
82 changes: 82 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,82 @@
# Based on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md

name: CI

on: [push, pull_request]

jobs:
check:
name: Check
runs-on: ubuntu-latest
strategy:
matrix:
toolchain: [stable, beta, nightly]
steps:
- name: Checkout sources
uses: actions/checkout@v1

- name: Install ${{ matrix.toolchain }} toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true

- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
args: --all-features --all

test:
name: Test Suite
runs-on: ubuntu-latest
strategy:
matrix:
toolchain: [stable, beta, nightly]
steps:
- name: Checkout sources
uses: actions/checkout@v1

- name: Install ${{ matrix.toolchain }} toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --all

lints:
name: Lints
runs-on: ubuntu-latest
strategy:
matrix:
toolchain: [stable, beta, nightly]
steps:
- name: Checkout sources
uses: actions/checkout@v1

- name: Install ${{ matrix.toolchain }} toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
components: rustfmt, clippy

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

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-features --all -- -D warnings
51 changes: 51 additions & 0 deletions .github/workflows/coverage.yml
@@ -0,0 +1,51 @@
# Based on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md

name: Coverage

on:
push:
branches:
- master

jobs:
grcov:
name: Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true

- name: Execute tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all --all-features
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off"

- name: Gather coverage data
id: coverage
uses: actions-rs/grcov@v0.1

- name: Coveralls upload
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
path-to-lcov: ${{ steps.coverage.outputs.report }}

grcov_finalize:
runs-on: ubuntu-latest
needs: grcov
steps:
- name: Coveralls finalization
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
3 changes: 1 addition & 2 deletions Cargo.toml
Expand Up @@ -11,8 +11,7 @@ categories = ["asynchronous", "network-programming"]
license = "MIT"

[badges]
travis-ci = {repository = "sile/rustun"}
codecov = {repository = "sile/rustun"}
coveralls = {repository = "sile/rustun"}

[dependencies]
bytecodec = "0.4"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -3,8 +3,8 @@ rustun

[![Crates.io: rustun](https://img.shields.io/crates/v/rustun.svg)](https://crates.io/crates/rustun)
[![Documentation](https://docs.rs/rustun/badge.svg)](https://docs.rs/rustun)
[![Build Status](https://travis-ci.org/sile/rustun.svg?branch=master)](https://travis-ci.org/sile/rustun)
[![Code Coverage](https://codecov.io/gh/sile/rustun/branch/master/graph/badge.svg)](https://codecov.io/gh/sile/rustun/branch/master)
[![Actions Status](https://github.com/sile/rustun/workflows/CI/badge.svg)](https://github.com/sile/rustun/actions)
[![Coverage Status](https://coveralls.io/repos/github/sile/rustun/badge.svg?branch=master)](https://coveralls.io/github/sile/rustun?branch=master)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

A Rust library for implementing STUN server and client asynchronously.
Expand Down

0 comments on commit ae1efc3

Please sign in to comment.