Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: cache ~/.cargo #43

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/actions/build-rspack/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,19 @@ outputs:
runs:
using: composite
steps:
- uses: actions/setup-node@v3
with:
node-version: 18
- shell: bash
name: Install package manager
run: |
npm install -g corepack@0.24.1
echo "Corepack version: $(corepack --version)"
corepack enable

- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'

- name: Checkout Rspack repo
uses: actions/checkout@v4
with:
Expand Down
31 changes: 27 additions & 4 deletions .github/actions/prepare-rspack-binding/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,37 @@ runs:
npm install -g corepack@0.24.1
echo "Corepack version: $(corepack --version)"
corepack enable
- id: rust-cache
- id: rust-target-cache
name: Cache Rust `target`
uses: MasterworksIO/action-local-cache@2
with:
path: '${{ inputs.path }}/target'
- name: Show Rust Cache
if: steps.rust-cache.outputs.cache-hit == 'true'
- name: Show Rust `target` Cache
if: steps.rust-target-cache.outputs.cache-hit == 'true'
shell: bash
run: ls -lah ${{ inputs.path }}/target
run: |
ls -lah ${{ inputs.path }}/target
echo "---------------------"
total_size=$(du -sh ${{ inputs.path }}/target | awk '{print $1}')
echo "Total size of directory contents: $total_size"
# - name: Print .cargo path and Export
# shell: bash
# run: |
# CARGO_PATH="${CARGO_HOME:-$HOME/.cargo}"
# echo "CARGO_PATH=$CARGO_PATH" >> $GITHUB_ENV
# - id: rust-cargo-cache
# name: Cache Rust `.cargo`
# uses: MasterworksIO/action-local-cache@2
# with:
# path: '${{ env.CARGO_PATH }}'
# - name: Show Rust `.cargo` Cache
# if: steps.rust-cargo-cache.outputs.cache-hit == 'true'
# shell: bash
# run: |
# ls -lah ${{ env.CARGO_PATH }}
# echo "---------------------"
# total_size=$(du -sh ${{ env.CARGO_PATH }} | awk '{print $1}')
# echo "Total size of directory contents: $total_size"
- name: Build Rspack
shell: bash
run: |
Expand Down
78 changes: 39 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,42 +21,42 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare-rspack-binding

ci:
needs: [get-runner-labels, prepare-binding]
strategy:
matrix:
include:
- suite: modernjs
os: ubuntu-latest
- suite: _selftest
os: ubuntu-latest
- suite: nx
os: ubuntu-latest
- suite: rspress
os: ubuntu-latest
- suite: rsbuild
os: ubuntu-latest
- suite: compat
os: ubuntu-latest
- suite: examples
os: ubuntu-latest
fail-fast: false
runs-on: ${{ matrix.os }}
name: ${{ matrix.suite }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build-rspack
- name: Install
run: pnpm install --frozen-lockfile --prefer-offline
- name: Format
if: matrix.suite == '_selftest'
run: pnpm format
- name: Lint
if: matrix.suite == '_selftest'
run: pnpm lint
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3
- run: >-
pnpm tsx ecosystem-ci.ts
run-suites
${{ matrix.suite }}
# ci:
# needs: [get-runner-labels, prepare-binding]
# strategy:
# matrix:
# include:
# - suite: modernjs
# os: ubuntu-latest
# - suite: _selftest
# os: ubuntu-latest
# - suite: nx
# os: ubuntu-latest
# - suite: rspress
# os: ubuntu-latest
# - suite: rsbuild
# os: ubuntu-latest
# - suite: compat
# os: ubuntu-latest
# - suite: examples
# os: ubuntu-latest
# fail-fast: false
# runs-on: ${{ matrix.os }}
# name: ${{ matrix.suite }}
# steps:
# - uses: actions/checkout@v4
# - uses: ./.github/actions/build-rspack
# - name: Install
# run: pnpm install --frozen-lockfile --prefer-offline
# - name: Format
# if: matrix.suite == '_selftest'
# run: pnpm format
# - name: Lint
# if: matrix.suite == '_selftest'
# run: pnpm lint
# - name: Expose GitHub Runtime
# uses: crazy-max/ghaction-github-runtime@v3
# - run: >-
# pnpm tsx ecosystem-ci.ts
# run-suites
# ${{ matrix.suite }}
Loading