tealdeer/.github/workflows/ci.yml
Niklas Mohrin a6023a5234
Small fixes in ci.yml
- Add `profile: minimal`
- Install `rustfmt` when installing the toolchain, not afterwards
- Use stable toolchain for `rustfmt`
- Replace `override` with `default`. I think this better reflects the
  "use what we just installed" intent.
2022-08-21 22:39:02 +02:00

95 lines
2.3 KiB
YAML

on:
push:
branches:
- main
pull_request:
schedule:
- cron: '30 3 * * 2'
name: CI
jobs:
test:
name: run tests
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
rust: ['1.62', stable]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
default: true
- name: Build with default features
uses: actions-rs/cargo@v1
with:
command: build
- name: Build with logging and webpki roots
uses: actions-rs/cargo@v1
with:
command: build
args: --features logging,webpki-roots --no-default-features
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
clippy:
name: run clippy lints
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
default: true
components: clippy
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --features logging
fmt:
name: run rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
default: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
docs:
name: build docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: '0.4.4'
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
default: true
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
- name: Ensure that docs can be built
run: cd docs && mdbook build
- name: Generate usage string
run: cargo run -- --help > docs/src/usage-actual.txt
- name: Ensure that usage string is up to date
run: diff docs/src/usage{,-actual}.txt