fix clippy workflow (hopefully)

This commit is contained in:
Oscar Beaumont 2022-06-20 11:27:37 +08:00 committed by GitHub
parent f8de1a81bf
commit 55e52eb2ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 48 additions and 9 deletions

View file

@ -10,10 +10,14 @@ if [ $? -eq 1 ]; then
exit 1
fi
which pnpm &> /dev/null
if [ $? -eq 1 ]; then
echo "PNPM was not detected on your system. Ensure the 'pnpm' command is in your \$PATH. You are **not** able to use Yarn or NPM."
exit 1
if [ "${SPACEDRIVE_SKIP_PNPM_CHECK:-}" != "true" ]; then
which pnpm &> /dev/null
if [ $? -eq 1 ]; then
echo "PNPM was not detected on your system. Ensure the 'pnpm' command is in your \$PATH. You are not able to use Yarn or NPM."
exit 1
fi
else
echo "Skipped PNPM check!"
fi
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
@ -24,7 +28,7 @@ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
DEBIAN_BINDGEN_DEPS="pkg-config clang" # Bindgen dependencies - it's used by a dependency of Spacedrive
sudo apt-get -y update
sudo apt-get -y install ${CUSTOM_APT_FLAGS:-} $DEBIAN_TAURI_DEPS $DEBIAN_FFMPEG_DEPS $DEBIAN_BINDGEN_DEPS
sudo apt-get -y install ${SPACEDRIVE_CUSTOM_APT_FLAGS:-} $DEBIAN_TAURI_DEPS $DEBIAN_FFMPEG_DEPS $DEBIAN_BINDGEN_DEPS
elif which pacman &> /dev/null; then
echo "Detected 'pacman' based distro!"
ARCH_TAURI_DEPS="webkit2gtk base-devel curl wget openssl appmenu-gtk-module gtk3 libappindicator-gtk3 librsvg libvips" # Tauri deps https://tauri.studio/guides/getting-started/setup/linux#1-system-dependencies

View file

@ -11,7 +11,7 @@ on:
env:
CARGO_INCREMENTAL: 1
CUSTOM_APT_FLAGS: --no-install-recommends
SPACEDRIVE_CUSTOM_APT_FLAGS: --no-install-recommends
jobs:
typescript:

View file

@ -5,17 +5,52 @@ on:
push:
paths:
- '**.rs'
- '**.toml'
- ./.github/workflows
workflow_dispatch:
env:
CARGO_INCREMENTAL: 1
SPACEDRIVE_CUSTOM_APT_FLAGS: --no-install-recommends
SPACEDRIVE_SKIP_PNPM_CHECK: true
jobs:
clippy_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v3
- run: rustup component add clippy
- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
components: clippy
- uses: actions-rs/clippy-check@v1
- name: Cache Rust Dependencies
uses: Swatinem/rust-cache@v1
with:
sharedKey: core-v1-${{ hashFiles('**/Cargo.lock') }}
- name: Run 'setup-system.sh' script
run: ./.github/scripts/setup-system.sh
- name: Cache Prisma codegen
id: cache-prisma
uses: actions/cache@v3
with:
path: ./core/src/prisma.rs
key: prisma-${{ hashFiles('./core/prisma/Cargo.toml', './core/prisma/schema.prisma', './core/prisma/src/main.rs') }}
- name: Generate Prisma client
working-directory: core
if: steps.cache-prisma.outputs.cache-hit != 'true'
run: cargo run --frozen -p prisma-cli --release -- generate
- name: Run Clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features