Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add github workflow #3

Merged
merged 1 commit into from
Jun 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
name: Auto Build CI
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
rust: [nightly, beta, stable]

steps:
- name: Checkout Repository
uses: actions/checkout@v3

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

- name: Install Dependencies (for ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install libssl-dev
- name: Cargo Build
uses: actions-rs/cargo@v1
with:
command: build

- name: Cargo Test For tokio
uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features --features runtime-tokio

- name: Cargo Test For async-std
uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features --features runtime-async-std

- name: Cargo Clippy
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'nightly'
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

- name: Cargo Fmt Check
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'nightly'
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check