Files
spacedrive/.github/actions/setup-rust/action.yaml
Vítor Vasconcellos a42bc63f5d Some misc fixes (#836)
* Fix setup-system breaking in macOS due to unavailable envvar
 - Remove unused docker build-arg from ffmpeg workflow
 - Fix Overview Explorer extending below inspector
 - Fix some left behind formatting problems

* Some more formatting
2023-05-20 04:36:35 +00:00

52 lines
1.6 KiB
YAML

name: Setup Rust and Prisma
description: Setup Rust and Prisma
inputs:
targets:
description: Comma-separated list of target triples to install for this toolchain
required: false
save-cache:
description: Whether to save the Rust cache
required: false
default: 'false'
runs:
using: 'composite'
steps:
- name: Install Rust
id: toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ inputs.targets }}
toolchain: stable
components: clippy, rustfmt
- name: Cache Rust Dependencies
uses: Swatinem/rust-cache@v2
with:
key: ${{ inputs.targets }}
save-if: ${{ inputs.save-cache }}
prefix-key: 'v0'
shared-key: rust-deps
# Windows is having disk related problems with target caching
cache-targets: ${{ runner.os != 'Windows' }}
- name: Restore cached Prisma codegen
id: cache-prisma-restore
uses: actions/cache/restore@v3
with:
key: prisma-0-${{ runner.os }}-${{ hashFiles('./core/prisma/*', './crates/sync-generator/*', './Cargo.toml') }}
path: ./core/src/prisma*.rs
- name: Generate Prisma client
working-directory: core
if: ${{ steps.cache-prisma-restore.outputs.cache-hit != 'true' }}
shell: bash
run: cargo run -p prisma-cli --bin prisma -- generate
- name: Save Prisma codegen
id: cache-prisma-save
if: ${{ inputs.save-cache == 'true' }}
uses: actions/cache/save@v3
with:
key: ${{ steps.cache-prisma-restore.outputs.cache-primary-key }}
path: ./core/src/prisma*.rs