diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9caa0c..3e5a274 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,6 +48,14 @@ jobs: - uses: actions/checkout@v4 - uses: oven-sh/setup-bun@v2 - uses: dtolnay/rust-toolchain@stable + - name: Cache Bun packages + uses: actions/cache@v4 + with: + path: ~/.bun/install/cache + key: ${{ runner.os }}-${{ runner.arch }}-bun-${{ hashFiles('bun.lock') }} + restore-keys: | + ${{ runner.os }}-${{ runner.arch }}-bun- + - uses: Swatinem/rust-cache@v2.9.2 - run: bun install --frozen-lockfile - run: bun run check - run: cargo check --locked --package friendolls @@ -59,9 +67,14 @@ jobs: steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2.9.2 - run: cargo test --locked --package friendolls-server + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v4 - name: Ensure the production image builds uses: docker/build-push-action@v6 with: context: . push: false + cache-from: type=gha,scope=server + cache-to: type=gha,mode=max,scope=server diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 70f4b7c..edd3e6c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -64,6 +64,16 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: targets: ${{ matrix.rust_target }} + - name: Cache Bun packages + uses: actions/cache@v4 + with: + path: ~/.bun/install/cache + key: ${{ runner.os }}-${{ runner.arch }}-bun-${{ hashFiles('bun.lock') }} + restore-keys: | + ${{ runner.os }}-${{ runner.arch }}-bun- + - uses: Swatinem/rust-cache@v2.9.2 + with: + shared-key: ${{ matrix.rust_target || 'native' }} - run: bun install --frozen-lockfile - name: Build and upload Tauri bundles uses: tauri-apps/tauri-action@v0 @@ -90,8 +100,12 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v4 - uses: docker/build-push-action@v6 with: context: . push: true tags: ghcr.io/wind-explorer/friendolls-server:latest + cache-from: type=gha,scope=server + cache-to: type=gha,mode=max,scope=server