Add caching for npm, Cargo, and Gradle to speed up builds
Some checks failed
Build / check-version (push) Successful in 6s
Build / create-tag (push) Has been skipped
Build / build-android (push) Has been cancelled
Build / create-release (push) Has been cancelled
Build / build-linux (push) Has been cancelled
Build / build-windows (push) Has been cancelled
Some checks failed
Build / check-version (push) Successful in 6s
Build / create-tag (push) Has been skipped
Build / build-android (push) Has been cancelled
Build / create-release (push) Has been cancelled
Build / build-linux (push) Has been cancelled
Build / build-windows (push) Has been cancelled
This commit is contained in:
@@ -10,6 +10,9 @@ on:
|
||||
|
||||
env:
|
||||
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
||||
CARGO_INCREMENTAL: 0
|
||||
CARGO_NET_RETRY: 10
|
||||
RUSTUP_MAX_RETRIES: 10
|
||||
|
||||
jobs:
|
||||
check-version:
|
||||
@@ -68,6 +71,28 @@ jobs:
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: Cache npm dependencies
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.npm
|
||||
node_modules
|
||||
cinny/node_modules
|
||||
key: npm-windows-${{ hashFiles('package-lock.json', 'cinny/package-lock.json') }}
|
||||
restore-keys: |
|
||||
npm-windows-
|
||||
|
||||
- name: Cache Cargo
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
src-tauri/target
|
||||
key: cargo-windows-${{ hashFiles('src-tauri/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
cargo-windows-
|
||||
|
||||
- name: Install Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
@@ -76,11 +101,11 @@ jobs:
|
||||
override: true
|
||||
|
||||
- name: Install dependencies (root)
|
||||
run: npm install
|
||||
run: npm ci --prefer-offline
|
||||
|
||||
- name: Install dependencies (cinny)
|
||||
working-directory: ./cinny
|
||||
run: npm install
|
||||
run: npm ci --prefer-offline
|
||||
|
||||
- name: Build Tauri app
|
||||
run: npm run tauri build
|
||||
@@ -112,6 +137,28 @@ jobs:
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: Cache npm dependencies
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.npm
|
||||
node_modules
|
||||
cinny/node_modules
|
||||
key: npm-linux-${{ hashFiles('package-lock.json', 'cinny/package-lock.json') }}
|
||||
restore-keys: |
|
||||
npm-linux-
|
||||
|
||||
- name: Cache Cargo
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
src-tauri/target
|
||||
key: cargo-linux-${{ hashFiles('src-tauri/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
cargo-linux-
|
||||
|
||||
- name: Install Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
@@ -125,11 +172,11 @@ jobs:
|
||||
sudo apt-get install -y libwebkit2gtk-4.1-dev libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev rpm
|
||||
|
||||
- name: Install dependencies (root)
|
||||
run: npm install
|
||||
run: npm ci --prefer-offline
|
||||
|
||||
- name: Install dependencies (cinny)
|
||||
working-directory: ./cinny
|
||||
run: npm install
|
||||
run: npm ci --prefer-offline
|
||||
|
||||
- name: Build Tauri app
|
||||
run: npm run tauri build
|
||||
@@ -183,6 +230,39 @@ jobs:
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: Cache npm dependencies
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.npm
|
||||
node_modules
|
||||
cinny/node_modules
|
||||
key: npm-android-${{ hashFiles('package-lock.json', 'cinny/package-lock.json') }}
|
||||
restore-keys: |
|
||||
npm-android-
|
||||
|
||||
- name: Cache Cargo
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
src-tauri/target
|
||||
key: cargo-android-${{ hashFiles('src-tauri/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
cargo-android-
|
||||
|
||||
- name: Cache Gradle
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
src-tauri/gen/android/.gradle
|
||||
key: gradle-${{ hashFiles('src-tauri/gen/android/**/*.gradle*', 'src-tauri/gen/android/gradle-wrapper.properties') }}
|
||||
restore-keys: |
|
||||
gradle-
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
@@ -205,11 +285,11 @@ jobs:
|
||||
rustup target add i686-linux-android --toolchain stable
|
||||
|
||||
- name: Install dependencies (root)
|
||||
run: npm install
|
||||
run: npm ci --prefer-offline
|
||||
|
||||
- name: Install dependencies (cinny)
|
||||
working-directory: ./cinny
|
||||
run: npm install
|
||||
run: npm ci --prefer-offline
|
||||
|
||||
- name: Build Android APK
|
||||
shell: powershell
|
||||
|
||||
Reference in New Issue
Block a user