-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e09df50
commit aab182e
Showing
5 changed files
with
158 additions
and
39 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Setup Node.js, pnpm and dependencies | ||
description: Setup Node.js, pnpm and dependencies | ||
inputs: | ||
token: | ||
description: Github token | ||
required: false | ||
default: '' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8.x.x | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
token: ${{ inputs.token }} | ||
check-latest: true | ||
node-version-file: '.nvmrc' | ||
|
||
- name: Install pnpm deps | ||
shell: ${{ runner.os == 'Windows' && 'powershell' || 'bash' }} | ||
run: pnpm i --frozen-lockfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
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: | ||
save-if: ${{ inputs.save-cache }} | ||
prefix-key: 'v0-rust-deps' | ||
shared-key: ${{ inputs.targets }} | ||
|
||
- name: Restore cached Prisma codegen | ||
id: cache-prisma-restore | ||
uses: actions/cache/restore@v3 | ||
with: | ||
key: prisma-1-${{ runner.os }}-${{ hashFiles('./core/prisma/*', './crates/sync-generator/*', './Cargo.toml') }} | ||
path: crates/prisma/src/**/*.rs | ||
|
||
- name: Generate Prisma client | ||
working-directory: core | ||
if: ${{ steps.cache-prisma-restore.outputs.cache-hit != 'true' }} | ||
shell: bash | ||
run: cargo 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: crates/prisma/src/**/*.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Setup System and Rust | ||
description: Setup System and Rust | ||
inputs: | ||
token: | ||
description: Github token | ||
required: false | ||
default: '' | ||
targets: | ||
description: Comma-separated list of target triples to install for this toolchain | ||
required: false | ||
setup-arg: | ||
description: Argument for the system setup script | ||
required: false | ||
default: '' | ||
save-cache: | ||
description: Whether to save the System cache | ||
required: false | ||
default: 'false' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Restore cached LLVM and Clang | ||
if: ${{ runner.os == 'Windows' }} | ||
id: cache-llvm-restore | ||
uses: actions/cache/restore@v3 | ||
with: | ||
key: llvm-15 | ||
path: C:/Program Files/LLVM | ||
|
||
- name: Install LLVM and Clang | ||
if: ${{ runner.os == 'Windows' }} | ||
uses: KyleMayes/install-llvm-action@v1 | ||
with: | ||
cached: ${{ steps.cache-llvm-restore.outputs.cache-hit }} | ||
version: '15' | ||
|
||
- name: Save LLVM and Clang | ||
if: ${{ runner.os == 'Windows' && inputs.save-cache == 'true' }} | ||
id: cache-llvm-save | ||
uses: actions/cache/save@v3 | ||
with: | ||
key: ${{ steps.cache-llvm-restore.outputs.cache-primary-key }} | ||
path: C:/Program Files/LLVM | ||
|
||
- name: Setup Rust and Dependencies | ||
uses: ./.github/actions/setup-rust | ||
with: | ||
targets: ${{ inputs.targets }} | ||
save-cache: ${{ inputs.save-cache }} | ||
|
||
- name: Run 'setup-system.sh' script | ||
shell: bash | ||
if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }} | ||
run: ./.github/scripts/setup-system.sh ${{ inputs.setup-arg }} | ||
env: | ||
TARGET: ${{ inputs.targets }} | ||
GITHUB_TOKEN: ${{ inputs.token }} | ||
APPLE_SIGNING_IDENTITY: ${{ env.APPLE_SIGNING_IDENTITY }} | ||
|
||
- name: Run 'setup-system.ps1' script | ||
shell: powershell | ||
if: ${{ runner.os == 'Windows' }} | ||
run: ./.github/scripts/setup-system.ps1 | ||
env: | ||
GITHUB_TOKEN: ${{ inputs.token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters