obsidian-export/.github/workflows/test.yml
2023-09-23 07:38:42 +00:00

82 lines
1.9 KiB
YAML

on: [push, pull_request]
name: CI tests
jobs:
linting:
name: Run lints
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- uses: actions-rs/cargo@v1
with:
command: check
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
test-linux:
name: Test on Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: test
test-windows:
name: Test on Windows
runs-on: windows-latest
steps:
- run: git config --system core.autocrlf false && git config --system core.eol lf
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: test
coverage:
name: Code coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/tarpaulin@v0.1
with:
# Constrained by https://github.com/actions-rs/tarpaulin/pull/23
version: "0.22.0"
args: "--ignore-tests"
out-type: "Html"
- uses: actions/upload-artifact@v3
with:
name: tarpaulin-report
path: tarpaulin-report.html