2022-12-14 20:38:55 -08:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- '*'
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
lint:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
env:
|
|
|
|
RUSTFLAGS: --deny warnings
|
|
|
|
|
|
|
|
steps:
|
2024-01-24 15:19:35 -08:00
|
|
|
- uses: actions/checkout@v4
|
2022-12-14 20:38:55 -08:00
|
|
|
|
2023-01-12 21:24:35 -08:00
|
|
|
- uses: Swatinem/rust-cache@v2
|
2022-12-14 20:38:55 -08:00
|
|
|
|
|
|
|
- name: Clippy
|
|
|
|
run: cargo clippy --all --all-targets
|
|
|
|
|
|
|
|
- name: Format
|
|
|
|
run: cargo fmt --all -- --check
|
|
|
|
|
2024-02-19 21:40:27 -08:00
|
|
|
- name: Install Dependencies
|
2022-12-14 20:38:55 -08:00
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2024-02-19 21:40:27 -08:00
|
|
|
sudo apt-get install ripgrep shellcheck
|
|
|
|
|
|
|
|
- name: Check for Forbidden Words
|
|
|
|
run: ./bin/forbid
|
|
|
|
|
|
|
|
- name: Check Install Script
|
|
|
|
run: shellcheck www/install.sh
|
2023-01-11 22:47:46 -08:00
|
|
|
|
2022-12-14 20:38:55 -08:00
|
|
|
pages:
|
|
|
|
runs-on: ubuntu-latest
|
2022-12-31 15:09:19 -08:00
|
|
|
permissions:
|
|
|
|
contents: write
|
2022-12-14 20:38:55 -08:00
|
|
|
|
|
|
|
env:
|
|
|
|
RUSTFLAGS: --deny warnings
|
|
|
|
|
|
|
|
steps:
|
2024-01-24 15:19:35 -08:00
|
|
|
- uses: actions/checkout@v4
|
2022-12-14 20:38:55 -08:00
|
|
|
|
2023-01-12 21:24:35 -08:00
|
|
|
- uses: Swatinem/rust-cache@v2
|
2022-12-14 20:38:55 -08:00
|
|
|
|
|
|
|
- name: Install `mdbook`
|
2024-01-25 17:31:16 -08:00
|
|
|
run: cargo install mdbook
|
2022-12-14 20:38:55 -08:00
|
|
|
|
|
|
|
- name: Install `mdbook-linkcheck`
|
|
|
|
run: |
|
|
|
|
mkdir -p mdbook-linkcheck
|
|
|
|
cd mdbook-linkcheck
|
|
|
|
wget https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/latest/download/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip
|
|
|
|
unzip mdbook-linkcheck.x86_64-unknown-linux-gnu.zip
|
|
|
|
chmod +x mdbook-linkcheck
|
|
|
|
pwd >> $GITHUB_PATH
|
|
|
|
|
|
|
|
- name: Build book
|
|
|
|
run: |
|
|
|
|
cargo run --package generate-book
|
|
|
|
mdbook build book/en
|
|
|
|
mdbook build book/zh
|
|
|
|
|
|
|
|
- name: Deploy Pages
|
2024-05-08 22:56:40 -07:00
|
|
|
uses: peaceiris/actions-gh-pages@v4
|
2022-12-14 20:38:55 -08:00
|
|
|
if: github.ref == 'refs/heads/master'
|
|
|
|
with:
|
|
|
|
github_token: ${{secrets.GITHUB_TOKEN}}
|
|
|
|
publish_branch: gh-pages
|
|
|
|
publish_dir: www
|
|
|
|
test:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os:
|
|
|
|
- ubuntu-latest
|
|
|
|
- macos-latest
|
|
|
|
- windows-latest
|
|
|
|
|
|
|
|
runs-on: ${{matrix.os}}
|
|
|
|
|
|
|
|
env:
|
|
|
|
RUSTFLAGS: --deny warnings
|
|
|
|
|
|
|
|
steps:
|
2024-01-24 15:19:35 -08:00
|
|
|
- uses: actions/checkout@v4
|
2022-12-14 20:38:55 -08: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
|
|
|
|
|
2023-01-12 21:24:35 -08:00
|
|
|
- uses: Swatinem/rust-cache@v2
|
2022-12-14 20:38:55 -08:00
|
|
|
|
|
|
|
- name: Test
|
|
|
|
run: cargo test --all
|
2023-01-04 23:19:42 -08:00
|
|
|
|
|
|
|
- name: Test install.sh
|
|
|
|
run: |
|
2024-05-01 11:01:02 -07:00
|
|
|
bash www/install.sh --to /tmp --tag 1.25.0
|
2023-01-04 23:19:42 -08:00
|
|
|
/tmp/just --version
|