mirror of
https://github.com/Nostalgica-Reverie/Content-Monorepo.git
synced 2026-05-09 00:24:15 +00:00
chore(ci): add caching again
This commit is contained in:
@@ -6,13 +6,13 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- 'modpacks/**'
|
- 'modpacks/**'
|
||||||
- 'datapacks/**'
|
- 'datapacks/**'
|
||||||
- 'src/actions/**'
|
- 'src/actions/builder/**'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: ["main"]
|
branches: ["main"]
|
||||||
paths:
|
paths:
|
||||||
- 'modpacks/**'
|
- 'modpacks/**'
|
||||||
- 'datapacks/**'
|
- 'datapacks/**'
|
||||||
- 'src/actions/**'
|
- 'src/actions/builder/**'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -27,7 +27,7 @@ jobs:
|
|||||||
sparse-checkout: |
|
sparse-checkout: |
|
||||||
modpacks
|
modpacks
|
||||||
datapacks
|
datapacks
|
||||||
src/actions
|
src/actions/builder
|
||||||
|
|
||||||
- name: Meta
|
- name: Meta
|
||||||
id: meta
|
id: meta
|
||||||
@@ -35,6 +35,31 @@ jobs:
|
|||||||
SHORT_SHA=$(git rev-parse --short HEAD)
|
SHORT_SHA=$(git rev-parse --short HEAD)
|
||||||
echo "short_sha=$SHORT_SHA" >> $GITHUB_OUTPUT
|
echo "short_sha=$SHORT_SHA" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
|
||||||
|
- name: Cache Builder Binary
|
||||||
|
id: cache-builder
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ./builder-bin
|
||||||
|
key: builder-v1-${{ runner.os }}-${{ hashFiles('src/actions/builder/**/*.rs', 'src/actions/builder/Cargo.toml', 'src/actions/builder/Cargo.lock') }}
|
||||||
|
|
||||||
|
- name: Install Rust
|
||||||
|
if: steps.cache-builder.outputs.cache-hit != 'true'
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- name: Rust Cache (Compiler Internals)
|
||||||
|
if: steps.cache-builder.outputs.cache-hit != 'true'
|
||||||
|
uses: Swatinem/rust-cache@v2
|
||||||
|
with:
|
||||||
|
workspaces: "src/actions/builder -> target"
|
||||||
|
|
||||||
|
- name: Build Builder
|
||||||
|
if: steps.cache-builder.outputs.cache-hit != 'true'
|
||||||
|
run: |
|
||||||
|
cargo build --release --manifest-path src/actions/builder/Cargo.toml --bin builder
|
||||||
|
mkdir -p ./builder-bin
|
||||||
|
cp src/actions/builder/target/release/builder ./builder-bin/builder
|
||||||
|
|
||||||
- name: Cache Go Binaries
|
- name: Cache Go Binaries
|
||||||
id: cache-go
|
id: cache-go
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
@@ -56,29 +81,6 @@ jobs:
|
|||||||
- name: Add Go bin to PATH
|
- name: Add Go bin to PATH
|
||||||
run: echo "$HOME/go/bin" >> $GITHUB_PATH
|
run: echo "$HOME/go/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
- name: Install Rust
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
|
||||||
|
|
||||||
- name: Cache Builder Binary
|
|
||||||
id: cache-builder
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: ./builder-bin
|
|
||||||
key: builder-v1-${{ runner.os }}-${{ hashFiles('src/actions/**/*.rs', 'src/actions/Cargo.toml', 'src/actions/Cargo.lock') }}
|
|
||||||
|
|
||||||
- name: Rust Cache
|
|
||||||
if: steps.cache-builder.outputs.cache-hit != 'true'
|
|
||||||
uses: Swatinem/rust-cache@v2
|
|
||||||
with:
|
|
||||||
workspaces: "src/actions -> target"
|
|
||||||
|
|
||||||
- name: Build Builder
|
|
||||||
if: steps.cache-builder.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
|
||||||
cargo build --release --manifest-path src/actions/Cargo.toml --bin builder
|
|
||||||
mkdir -p ./builder-bin
|
|
||||||
cp src/actions/target/release/builder ./builder-bin/builder
|
|
||||||
|
|
||||||
- name: Run Build
|
- name: Run Build
|
||||||
run: |
|
run: |
|
||||||
chmod +x ./builder-bin/builder
|
chmod +x ./builder-bin/builder
|
||||||
|
|||||||
Reference in New Issue
Block a user