Skip to content

Commit

Permalink
ci: fix Rust cache (#9377)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Dec 27, 2024
1 parent 6da10f9 commit 12bfbf1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
11 changes: 3 additions & 8 deletions .github/actions/build-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,10 @@ runs:
echo "TARGET_CC=clang" >> "$GITHUB_ENV"
- name: Cache cargo
uses: actions/cache@v4
uses: Swatinem/rust-cache@v2
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.napi-rs
target/${{ inputs.target }}
key: stable-${{ inputs.target }}-cargo-cache
save-if: ${{ github.ref_name == 'canary' }}
shared-key: ${{ inputs.target }}-inputs.package
- name: Build
shell: bash
run: |
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ jobs:
name: Optimize CI
runs-on: ubuntu-latest
outputs:
skip: ${{ steps.graphite.outputs.skip }}
skip: ${{ steps.check_skip.outputs.skip }}
steps:
- uses: actions/checkout@v4
- name: Graphite CI Optimizer
uses: withgraphite/graphite-ci-action@main
id: graphite
id: check_skip
with:
token: ${{ secrets.GRAPHITE_CI_OPTIMIZER_TOKEN }}
graphite_token: ${{ secrets.GRAPHITE_CI_OPTIMIZER_TOKEN }}

analyze:
name: Analyze
Expand Down Expand Up @@ -311,6 +311,8 @@ jobs:
build-server-native:
name: Build Server native
runs-on: ubuntu-latest
needs: optimize_ci
if: needs.optimize_ci.outputs.skip == 'false'
env:
CARGO_PROFILE_RELEASE_DEBUG: '1'
steps:
Expand All @@ -335,7 +337,8 @@ jobs:
build-electron-renderer:
name: Build @affine/electron renderer
runs-on: ubuntu-latest

needs: optimize_ci
if: needs.optimize_ci.outputs.skip == 'false'
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
Expand Down Expand Up @@ -425,6 +428,8 @@ jobs:
rust-test:
name: Run native tests
runs-on: ubuntu-latest
needs: optimize_ci
if: needs.optimize_ci.outputs.skip == 'false'
env:
CARGO_TERM_COLOR: always
steps:
Expand Down Expand Up @@ -826,6 +831,8 @@ jobs:

test-build-mobile-app:
uses: ./.github/workflows/release-mobile.yml
needs: optimize_ci
if: needs.optimize_ci.outputs.skip == 'false'
with:
build-type: canary
build-target: development
Expand Down

0 comments on commit 12bfbf1

Please sign in to comment.