Skip to content

ci: run clippy in CI #57

ci: run clippy in CI

ci: run clippy in CI #57

Workflow file for this run

name: Rust
on: [ push, pull_request ]
env:
CARGO_TERM_COLOR: always
ZLIB_VERSION: "1.3"
jobs:
test-linux:
name: Test (Linux)
runs-on: ubuntu-latest
steps:
- name: checkout source
uses: actions/checkout@v3
- name: set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: set up nginx deps cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
.cache/.gnupg
.cache/*.tar.gz
.cache/*.tar.asc
.cache/*.tar.sig
key: ${{ runner.os }}-deps-${{ hashFiles('**/nginx-sys/build.rs') }}
restore-keys: ${{ runner.os }}-deps-
- name: run tests
run: cargo test --verbose
test-macos:
name: Test (MacOS)
runs-on: macos-latest
steps:
- name: install GNU make 4
run: brew install make openssl
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: set up nginx deps cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
.cache/.gnupg
.cache/*.tar.gz
.cache/*.tar.asc
.cache/*.tar.sig
key: ${{ runner.os }}-deps-${{ hashFiles('**/nginx-sys/build.rs') }}
restore-keys: ${{ runner.os }}-deps-
- name: run tests
uses: actions-rs/cargo@v1
env:
ZLIB_VERSION: "1.3"
with:
command: test
args: --verbose
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add rustfmt
- name: cargo fmt
run: cargo fmt --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: set up nginx deps source cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
.cache/.gnupg
.cache/*.tar.gz
.cache/*.tar.asc
.cache/*.tar.sig
key: ${{ runner.os }}-deps-${{ hashFiles('**/nginx-sys/build.rs') }}
restore-keys: ${{ runner.os }}-deps-
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: run clippy
run: cargo clippy -- -D warnings
# docs:
# name: Docs
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
# - name: Install Rust
# uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# profile: minimal
# override: true
# - name: Check documentation
# env:
# RUSTDOCFLAGS: -D warnings
# uses: actions-rs/cargo@v1
# with:
# command: doc
# args: --no-deps --document-private-items