Skip to content

Commit

Permalink
ci: add clippy test for macos and windows
Browse files Browse the repository at this point in the history
  • Loading branch information
yihau committed Nov 29, 2023
1 parent ded307a commit 264dff8
Showing 1 changed file with 83 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/cargo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Cargo

on:
push:
branches:
- master
- v[0-9]+.[0-9]+
pull_request:
branches:
- master
- v[0-9]+.[0-9]+
paths:
- "**.rs"
- "Cargo.toml"
- "Cargo.lock"
- ".github/workflows/cargo-check"
workflow_call:
inputs:
branch:
required: false
type: string
default: "master"

env:
SHELL: /bin/bash
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"

jobs:
# macos:
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v4

# - uses: mozilla-actions/sccache-action@v0.0.3
# with:
# version: "v0.5.4"

# - name: prepare
# shell: bash
# run: |
# brew install protobuf

# - shell: bash
# run: |
# source ci/rust-version.sh all
# rustup component add clippy --toolchain "$rust_stable"
# rustup component add clippy --toolchain "$rust_nightly"
# scripts/cargo-clippy.sh

windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- uses: mozilla-actions/sccache-action@v0.0.3
with:
version: "v0.5.4"

- name: prepare
shell: bash
run: |
choco install openssl
if [[ -d "C:\Program Files\OpenSSL" ]]; then
echo "OPENSSL_DIR: C:\Program Files\OpenSSL"
echo "OPENSSL_DIR=C:\Program Files\OpenSSL" >> $GITHUB_ENV
elif [[ -d "C:\Program Files\OpenSSL-Win64" ]]; then
echo "OPENSSL_DIR: C:\Program Files\OpenSSL-Win64"
echo "OPENSSL_DIR=C:\Program Files\OpenSSL-Win64" >> $GITHUB_ENV
else
echo "can't determine OPENSSL_DIR"
exit 1
fi
choco install protoc
echo "PROTOC=C:\ProgramData\chocolatey\lib\protoc\tools\bin\protoc.exe" >> $GITHUB_ENV
- shell: bash
run: |
source ci/rust-version.sh all
rustup component add clippy --toolchain "$rust_stable"
rustup component add clippy --toolchain "$rust_nightly"
scripts/cargo-clippy.sh

0 comments on commit 264dff8

Please sign in to comment.