Merge remote-tracking branch 'refs/remotes/origin/dev' into dev #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: ["dev", "master"] | |
pull_request: | |
branches: [master] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
rust: [stable, "1.70"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Restore cargo cache | |
uses: actions/cache@v2 | |
env: | |
cache-name: ci | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
~/.cargo/bin | |
target | |
key: ${{ matrix.os }}-${{ env.cache-name }}-${{ matrix.rust }}-${{ hashFiles('Cargo.lock') }} | |
- name: MacOS Workaround | |
if: matrix.os == 'macos-latest' | |
run: cargo clean -p serde_derive -p thiserror | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust }} | |
default: true | |
override: true | |
profile: minimal | |
components: clippy | |
- name: Build Debug | |
run: | | |
cargo build | |
- name: Run tests | |
run: cargo test | |
- name: Run clippy | |
run: | | |
cargo clippy --workspace --all-features | |
- name: Build Release | |
run: cargo build --release | |
- name: Test Install | |
run: cargo install --path "." --force | |
- name: Binary Size (unix) | |
if: matrix.os != 'windows-latest' | |
run: | | |
ls -l ./target/release/leetui | |
- name: Binary Size (win) | |
if: matrix.os == 'windows-latest' | |
run: | | |
ls -l ./target/release/leetui.exe | |
- name: Binary dependencies (mac) | |
if: matrix.os == 'macos-latest' | |
run: | | |
otool -L ./target/release/leetui | |
linting: | |
name: Lints | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
components: rustfmt | |
- run: cargo fmt -- --check | |
- name: cargo-sort | |
run: | | |
cargo install cargo-sort --force | |
cargo sort -c -w | |
- name: cargo-deny install | |
run: | | |
cargo install --locked cargo-deny | |
# - name: cargo-deny licenses | |
# run: | | |
# cargo deny check licenses | |
- name: cargo-deny bans | |
run: | | |
cargo deny check bans | |
udeps: | |
name: udeps | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
override: true | |
- name: cargo-udeps | |
run: | | |
# cargo install --locked cargo-udeps | |
cargo install --git https://github.com/est31/cargo-udeps --locked | |
cargo +nightly udeps --all-targets | |
# sec: | |
# name: Security audit | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - uses: actions-rs/audit-check@v1 | |
# with: | |
# token: ${{ secrets.GITHUB_TOKEN }} | |
# log-test: | |
# name: Changelog Test | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@master | |
# - name: Extract release notes | |
# id: extract_release_notes | |
# uses: ffurrer2/extract-release-notes@v1 | |
# with: | |
# release_notes_file: ./release-notes.txt | |
# - uses: actions/upload-artifact@v1 | |
# with: | |
# name: release-notes.txt | |
# path: ./release-notes.txt |