Skip to content

Commit

Permalink
add proper CI
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed Aug 29, 2023
1 parent f709f92 commit f310df4
Show file tree
Hide file tree
Showing 6 changed files with 132 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: [robjtede]
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
- package-ecosystem: cargo
directory: /
schedule:
interval: daily
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI

on:
pull_request:
branches: [main]
push:
branches: [main]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- '1.66' # MSRV
- stable
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
with:
components: clippy

- name: Test
run: cargo test --all-features
36 changes: 36 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Coverage

on:
push:
branches: [main]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
with:
components: llvm-tools-preview

- name: Install cargo-llvm-cov
uses: taiki-e/install-action@v2.17.0
with:
tool: cargo-llvm-cov

- name: Generate code coverage
run: cargo llvm-cov --workspace --all-features --codecov --output-path codecov.json

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3.1.4
with:
files: codecov.json
fail_ci_if_error: true
51 changes: 51 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Lint

on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches: [main]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt

- name: Format Check
uses: actions-rust-lang/rustfmt@v1

clippy:
name: Clippy
runs-on: ubuntu-latest
permissions:
checks: write

steps:
- uses: actions/checkout@v3

- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy

- name: Clippy Check
uses: giraffate/clippy-action@v1
with:
reporter: github-pr-check
github_token: ${{ secrets.GITHUB_TOKEN }}
clippy_flags: --workspace --all-targets --all-features
21 changes: 0 additions & 21 deletions .github/workflows/rust.yml

This file was deleted.

0 comments on commit f310df4

Please sign in to comment.