-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from ice-lab/feat/basic-structure
feat: basic project structure
- Loading branch information
Showing
101 changed files
with
12,840 additions
and
1,873 deletions.
There are no files selected for viewing
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
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,37 @@ | ||
name: clone crates | ||
|
||
description: clone rspack crates for github | ||
|
||
inputs: | ||
repo: | ||
default: 'web-infra-dev/rspack' | ||
required: false | ||
type: string | ||
dest: | ||
default: 'crates/.rspack_crates' | ||
required: false | ||
type: string | ||
ref: | ||
default: 'v0.4.0' | ||
required: false | ||
type: string | ||
temp: | ||
default: 'crates/.rspack_crates/.temp' | ||
required: false | ||
type: string | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Clone Repo | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: web-infra-dev/rspack | ||
path: ${{ inputs.temp }} | ||
ref: ${{ inputs.ref }} | ||
|
||
- name: Clean up | ||
shell: bash | ||
run: node scripts/clean.mjs | ||
env: | ||
IS_GITHUB: true |
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,58 @@ | ||
name: pnpm cache | ||
|
||
description: Install Node.js with pnpm global cache | ||
|
||
inputs: | ||
node-version: | ||
default: '18' | ||
required: false | ||
type: string | ||
save-if: | ||
default: false | ||
required: false | ||
type: boolean | ||
|
||
env: | ||
IS_GITHUB_RUNNER: startsWith(runner.name, 'GitHub Actions') | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ inputs.node-version }} | ||
check-latest: true | ||
|
||
# https://pnpm.io/continuous-integration#github-actions | ||
# Uses `packageManagement` field from package.json | ||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
dest: ${{ runner.tool_cache }}/pnpm | ||
|
||
- name: Get pnpm store directory | ||
id: pnpm-cache | ||
shell: bash | ||
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
|
||
- name: Restore pnpm cache | ||
id: restore | ||
if: ${{ env.IS_GITHUB_RUNNER }} | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | ||
key: node-cache-${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} | ||
restore-keys: | | ||
node-cache-${{ runner.os }}-pnpm- | ||
- name: Install dependencies | ||
shell: bash | ||
run: pnpm install --no-frozen-lockfile | ||
|
||
- name: Save pnpm cache | ||
uses: actions/cache/save@v3 | ||
if: ${{ env.IS_GITHUB_RUNNER && inputs.save-if == 'true' && steps.restore.outputs.cache-hit != 'true' }} | ||
with: | ||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | ||
key: node-cache-${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} |
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,86 @@ | ||
# This action installs the minimal Rust profile and configures Swatinem/rust-cache. | ||
# | ||
# It is needed to install as few Rust components as possbile because | ||
# it takes a few minutes to install some of components on Windows and Mac, especially rust-doc. | ||
|
||
name: Rustup | ||
|
||
description: Install Rust with cache | ||
|
||
inputs: | ||
# See https://rust-lang.github.io/rustup/concepts/components.html | ||
clippy: | ||
default: false | ||
required: false | ||
type: boolean | ||
fmt: | ||
default: false | ||
required: false | ||
type: boolean | ||
docs: | ||
default: false | ||
required: false | ||
type: boolean | ||
save-cache: | ||
default: false | ||
required: false | ||
type: boolean | ||
shared-key: | ||
default: 'check' | ||
required: false | ||
type: string | ||
|
||
env: | ||
IS_GITHUB_RUNNER: startsWith(runner.name, 'GitHub Actions') | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Print Inputs | ||
shell: bash | ||
run: | | ||
echo 'clippy: ${{ inputs.clippy }}' | ||
echo 'fmt: ${{ inputs.fmt }}' | ||
echo 'docs: ${{ inputs.docs }}' | ||
echo 'save-cache: ${{ inputs.save-cache }}' | ||
echo 'shared-key: ${{ inputs.shared-key }}' | ||
- name: Remove `profile` line on MacOS | ||
shell: bash | ||
if: runner.os == 'macOS' | ||
run: sed -i '' '/profile/d' rust-toolchain.toml | ||
|
||
- name: Remove `profile` line on non-MacOS | ||
shell: bash | ||
if: runner.os != 'macOS' | ||
run: sed -i '/profile/d' rust-toolchain.toml | ||
|
||
- name: Set minimal | ||
shell: bash | ||
run: rustup set profile minimal | ||
|
||
- name: Add Clippy | ||
shell: bash | ||
if: ${{ inputs.clippy == 'true' }} | ||
run: rustup component add clippy | ||
|
||
- name: Add Rustfmt | ||
shell: bash | ||
if: ${{ inputs.fmt == 'true' }} | ||
run: rustup component add rustfmt | ||
|
||
- name: Add docs | ||
shell: bash | ||
if: ${{ inputs.docs == 'true' }} | ||
run: rustup component add rust-docs | ||
|
||
- name: Install | ||
shell: bash | ||
run: rustup show | ||
|
||
- name: Cache on ${{ github.ref_name }} | ||
uses: Swatinem/rust-cache@v2 | ||
if: ${{ env.IS_GITHUB_RUNNER }} | ||
with: | ||
shared-key: ${{ inputs.shared-key }} | ||
save-if: ${{ inputs.save-cache == 'true' }} |
Oops, something went wrong.