From f16595acb2cc69bc509c4984273a5ea2a51d5819 Mon Sep 17 00:00:00 2001 From: Abdenasser Date: Fri, 8 Nov 2024 16:52:21 +0100 Subject: [PATCH 1/3] improve build-check --- .github/workflows/build-check.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-check.yml b/.github/workflows/build-check.yml index 5e96c33..41e53f2 100644 --- a/.github/workflows/build-check.yml +++ b/.github/workflows/build-check.yml @@ -23,11 +23,15 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable - + with: + components: cargo + + - uses: Swatinem/rust-cache@v2 + - name: Install Linux Dependencies run: | sudo apt-get update - sudo apt-get install -y \ + sudo apt-get install --no-install-recommends -y \ build-essential \ pkg-config \ libgtk-3-dev \ @@ -39,10 +43,7 @@ jobs: libwebkit2gtk-4.1-dev - name: Install Dependencies - run: npm install - - - name: Build Frontend - run: npm run build + run: npm ci - name: Build Application - run: npm run tauri build \ No newline at end of file + run: npm run tauri build \ No newline at end of file From 3389941cca72bd1b39a4a9c41ca22822dea6fdf8 Mon Sep 17 00:00:00 2001 From: Abdenasser Date: Fri, 8 Nov 2024 17:03:23 +0100 Subject: [PATCH 2/3] caching linux dependencies between build checks --- .github/workflows/build-check.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/build-check.yml b/.github/workflows/build-check.yml index 41e53f2..019123d 100644 --- a/.github/workflows/build-check.yml +++ b/.github/workflows/build-check.yml @@ -28,6 +28,15 @@ jobs: - uses: Swatinem/rust-cache@v2 + - name: Cache Linux Dependencies + id: cache-apt + uses: actions/cache@v3 + with: + path: /var/cache/apt/archives + key: ${{ runner.os }}-apt-${{ hashFiles('.github/workflows/build-check.yml') }} + restore-keys: | + ${{ runner.os }}-apt- + - name: Install Linux Dependencies run: | sudo apt-get update From ac9d60053186a6dc7d332877ae7beab76c29a215 Mon Sep 17 00:00:00 2001 From: Abdenasser Date: Fri, 8 Nov 2024 17:16:05 +0100 Subject: [PATCH 3/3] caching linux dependencies between build checks --- .github/workflows/build-check.yml | 32 ++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-check.yml b/.github/workflows/build-check.yml index 019123d..6a2bd51 100644 --- a/.github/workflows/build-check.yml +++ b/.github/workflows/build-check.yml @@ -6,6 +6,12 @@ on: env: CARGO_TERM_COLOR: always + CARGO_INCREMENTAL: 1 + CARGO_NET_RETRY: 10 + RUSTUP_MAX_RETRIES: 10 + RUST_BACKTRACE: 1 + RUSTC_WRAPPER: sccache + CARGO_BUILD_JOBS: ${{ runtime.numCPU }} jobs: build: @@ -21,23 +27,19 @@ jobs: node-version: 'lts/*' cache: 'npm' - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - components: cargo - - - uses: Swatinem/rust-cache@v2 - - name: Cache Linux Dependencies id: cache-apt uses: actions/cache@v3 with: - path: /var/cache/apt/archives - key: ${{ runner.os }}-apt-${{ hashFiles('.github/workflows/build-check.yml') }} + path: | + /var/cache/apt + /var/lib/apt/lists + key: ${{ runner.os }}-apt-${{ hashFiles('**/build-check.yml') }} restore-keys: | ${{ runner.os }}-apt- - name: Install Linux Dependencies + if: steps.cache-apt.outputs.cache-hit != 'true' run: | sudo apt-get update sudo apt-get install --no-install-recommends -y \ @@ -50,6 +52,18 @@ jobs: libjavascriptcoregtk-4.0-dev \ libsoup-3.0-dev \ libwebkit2gtk-4.1-dev + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + components: cargo + target: x86_64-unknown-linux-gnu + profile: minimal + + - uses: Swatinem/rust-cache@v2 + with: + shared-key: "build" + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Install Dependencies run: npm ci