diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 171b814..00d751c 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -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