Skip to content

Merge pull request #5 from felipet/devel #21

Merge pull request #5 from felipet/devel

Merge pull request #5 from felipet/devel #21

Workflow file for this run

name: Rust CI Flow
on:
push:
branches: [ "main", "devel" ]
env:
CARGO_TERM_COLOR: always
jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Enforce formatting
run: cargo fmt --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Linting
run: cargo clippy --no-deps -- -D warnings
test:
name: Test
runs-on: ubuntu-latest
needs: [clippy, fmt]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install tarpaulin
run: cargo install cargo-tarpaulin
- name: Tests
run: cargo test
env:
MAILJET_API_KEY: ${{ secrets.MAILJET_API_KEY }}
MAILJET_API_USER: ${{ secrets.MAILJET_API_USER }}
MAILJET_FROM_EMAIL: ${{ vars.MAILJET_FROM_EMAIL }}
- name: Generate code coverage
run: cargo tarpaulin --verbose --all-features --timeout 120 --out xml
env:
MAILJET_API_KEY: ${{ secrets.MAILJET_API_KEY }}
MAILJET_API_USER: ${{ secrets.MAILJET_API_USER }}
MAILJET_FROM_EMAIL: ${{ vars.MAILJET_FROM_EMAIL }}
- name: Upload coverage to codecov.io
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true