2022-01-30 12:37:15 -08:00
|
|
|
name: CI
|
2021-11-21 16:55:21 -08:00
|
|
|
|
2021-12-01 15:32:12 -08:00
|
|
|
on:
|
|
|
|
pull_request:
|
2021-12-05 02:51:15 -08:00
|
|
|
branches:
|
|
|
|
- '*'
|
|
|
|
push:
|
2021-12-01 15:32:12 -08:00
|
|
|
branches:
|
|
|
|
- master
|
2021-11-21 16:55:21 -08:00
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
all:
|
|
|
|
name: All
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os:
|
|
|
|
- ubuntu-latest
|
|
|
|
- macos-latest
|
2022-03-22 20:26:55 -07:00
|
|
|
- windows-latest
|
2021-11-21 16:55:21 -08:00
|
|
|
|
|
|
|
runs-on: ${{matrix.os}}
|
|
|
|
|
|
|
|
env:
|
|
|
|
RUSTFLAGS: --deny warnings
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
2022-03-22 20:26:55 -07:00
|
|
|
- name: Remove Broken WSL bash executable
|
|
|
|
if: ${{ matrix.os == 'windows-latest' }}
|
|
|
|
shell: cmd
|
|
|
|
run: |
|
|
|
|
takeown /F C:\Windows\System32\bash.exe
|
|
|
|
icacls C:\Windows\System32\bash.exe /grant administrators:F
|
|
|
|
del C:\Windows\System32\bash.exe
|
|
|
|
|
2021-11-21 16:55:21 -08:00
|
|
|
- name: Install Rust Toolchain Components
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
components: clippy, rustfmt
|
|
|
|
override: true
|
2022-05-03 23:05:55 -07:00
|
|
|
toolchain: 1.53.0
|
2021-11-21 16:55:21 -08:00
|
|
|
|
|
|
|
- uses: Swatinem/rust-cache@v1
|
|
|
|
|
|
|
|
- name: Check Lockfile
|
|
|
|
run: |
|
|
|
|
cargo update --locked --package just
|
|
|
|
|
|
|
|
- name: Test
|
|
|
|
run: cargo test --all
|
|
|
|
|
|
|
|
- name: Clippy
|
|
|
|
run: cargo clippy --all --all-targets
|
|
|
|
|
|
|
|
- name: Format
|
|
|
|
run: cargo fmt --all -- --check
|
|
|
|
|
|
|
|
- name: Completion Scripts
|
|
|
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
|
|
run: |
|
|
|
|
./bin/generate-completions
|
|
|
|
git diff --no-ext-diff --quiet --exit-code
|
|
|
|
|
|
|
|
- name: Check for Forbidden Words
|
|
|
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install ripgrep
|
|
|
|
./bin/forbid
|
2022-05-03 23:05:55 -07:00
|
|
|
|
|
|
|
- name: Install `mdbook`
|
|
|
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
|
|
uses: peaceiris/actions-mdbook@v1
|
|
|
|
with:
|
|
|
|
mdbook-version: latest
|
|
|
|
|
|
|
|
- name: Build book
|
|
|
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
|
|
run: |
|
|
|
|
cargo run --package generate-book
|
|
|
|
mdbook build book
|
|
|
|
|
|
|
|
- name: Deploy Pages
|
|
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
|
|
if: github.ref == 'refs/heads/master' && matrix.os == 'ubuntu-latest'
|
|
|
|
with:
|
|
|
|
github_token: ${{secrets.GITHUB_TOKEN}}
|
|
|
|
publish_branch: gh-pages
|
|
|
|
publish_dir: www
|