Skip to content

Commit

Permalink
ci: run clippy in GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanitskiy committed Aug 31, 2023
1 parent d1e073a commit d4aef0f
Showing 1 changed file with 67 additions and 22 deletions.
89 changes: 67 additions & 22 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on: [ push, pull_request ]

env:
CARGO_TERM_COLOR: always
ZLIB_VERSION: "1.3"

jobs:
test-linux:
Expand Down Expand Up @@ -33,8 +34,11 @@ jobs:
.cache/*.tar.sig
key: nginx-${{ hashFiles('**/nginx-sys/build.rs') }}
restore-keys: nginx-
- name: run tests in container
run: make container-test
- name: run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose

test-macos:
name: Test (MacOS)
Expand All @@ -53,12 +57,14 @@ jobs:
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo
restore-keys: ${{ runner.os }}-cargo
- name: set up nginx source binary cache
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:
Expand All @@ -67,8 +73,8 @@ jobs:
.cache/*.tar.gz
.cache/*.tar.asc
.cache/*.tar.sig
key: nginx-${{ hashFiles('**/nginx-sys/build.rs') }}
restore-keys: nginx-
key: ${{ runner.os }}-deps-${{ hashFiles('**/nginx-sys/build.rs') }}
restore-keys: ${{ runner.os }}-deps-
- name: run tests
uses: actions-rs/cargo@v1
env:
Expand All @@ -93,21 +99,60 @@ jobs:
command: fmt
args: --all -- --check

# clippy:
# name: Clippy
# 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 clippy
# - uses: actions-rs/cargo@v1
# with:
# command: clippy
# args: -- -D warnings
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-
- name: Install dependencies
run: |
sudo apt-get -qq update
sudo apt-get -qq install --yes --no-install-recommends --no-install-suggests \
libclang-dev \
libssl-dev \
pkg-config \
git \
grep \
gawk \
gnupg2 \
sed \
make
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
# - name: run clippy
# continue-on-error: true
# run: cargo clippy -- -D warnings
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

# docs:
# name: Docs
Expand Down

0 comments on commit d4aef0f

Please sign in to comment.