From 775202da97b0e3fdd888097852e6c60ab6671431 Mon Sep 17 00:00:00 2001 From: Tlntin Date: Sun, 5 Feb 2023 10:05:08 +0800 Subject: [PATCH 1/4] add cache for arrch64 when compile in action --- .github/workflows/pake_build_with_cache.yaml | 25 +++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pake_build_with_cache.yaml b/.github/workflows/pake_build_with_cache.yaml index 0fdb575..514ba64 100644 --- a/.github/workflows/pake_build_with_cache.yaml +++ b/.github/workflows/pake_build_with_cache.yaml @@ -106,6 +106,17 @@ jobs: steps: - uses: actions/checkout@v3 + - name: rust cache restore + uses: ylemkimon/cache-restore@v2 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + src-tauri/target/ + key: ${{ runner.os }}-aarch64-cargo-${{ hashFiles('**/Cargo.lock') }} + - uses: uraimo/run-on-arch-action@v2.3.0 name: build native modules using another arch with: @@ -115,6 +126,7 @@ jobs: dockerRunArgs: | --volume "${PWD}:/build" --volume "/home/runner:/home/runner" + --volume "~/.cargo:~/.cargo" install: | apt-get update && apt-get install -y gnupg2 && apt-get install curl -y curl -fsSL https://deb.nodesource.com/setup_18.x | bash - @@ -137,4 +149,15 @@ jobs: UPLOADTOOL_ISPRERELEASE: true run: | curl -L https://github.com/probonopd/uploadtool/raw/master/upload.sh --output upload.sh - bash upload.sh output/*/*.* \ No newline at end of file + bash upload.sh output/*/*.* + + - name: rust cache store + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + src-tauri/target/ + key: ${{ runner.os }}-aarch64-cargo-${{ hashFiles('**/Cargo.lock') }} \ No newline at end of file From 0388a1f0655e39f0817cbfbeb5006b85c79528f4 Mon Sep 17 00:00:00 2001 From: Tlntin Date: Sun, 5 Feb 2023 10:06:05 +0800 Subject: [PATCH 2/4] add cache for arrch64 when compile in action --- .github/workflows/pake_build_with_cache.yaml | 40 ++++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/pake_build_with_cache.yaml b/.github/workflows/pake_build_with_cache.yaml index 514ba64..7b2c08e 100644 --- a/.github/workflows/pake_build_with_cache.yaml +++ b/.github/workflows/pake_build_with_cache.yaml @@ -106,16 +106,16 @@ jobs: steps: - uses: actions/checkout@v3 - - name: rust cache restore - uses: ylemkimon/cache-restore@v2 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - src-tauri/target/ - key: ${{ runner.os }}-aarch64-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: rust cache restore + uses: ylemkimon/cache-restore@v2 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + src-tauri/target/ + key: ${{ runner.os }}-aarch64-cargo-${{ hashFiles('**/Cargo.lock') }} - uses: uraimo/run-on-arch-action@v2.3.0 name: build native modules using another arch @@ -151,13 +151,13 @@ jobs: curl -L https://github.com/probonopd/uploadtool/raw/master/upload.sh --output upload.sh bash upload.sh output/*/*.* - - name: rust cache store - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - src-tauri/target/ - key: ${{ runner.os }}-aarch64-cargo-${{ hashFiles('**/Cargo.lock') }} \ No newline at end of file + - name: rust cache store + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + src-tauri/target/ + key: ${{ runner.os }}-aarch64-cargo-${{ hashFiles('**/Cargo.lock') }} \ No newline at end of file From 2fc542f9b491d4adc984184fd56d1c04f02c2b39 Mon Sep 17 00:00:00 2001 From: Tlntin Date: Sun, 5 Feb 2023 10:23:12 +0800 Subject: [PATCH 3/4] add cache for arrch64 when compile in action --- .github/workflows/pake_build_with_cache.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pake_build_with_cache.yaml b/.github/workflows/pake_build_with_cache.yaml index 7b2c08e..b9ce8ab 100644 --- a/.github/workflows/pake_build_with_cache.yaml +++ b/.github/workflows/pake_build_with_cache.yaml @@ -126,7 +126,7 @@ jobs: dockerRunArgs: | --volume "${PWD}:/build" --volume "/home/runner:/home/runner" - --volume "~/.cargo:~/.cargo" + --volume "/home/runner/.cargo:/home/runner/.cargo" install: | apt-get update && apt-get install -y gnupg2 && apt-get install curl -y curl -fsSL https://deb.nodesource.com/setup_18.x | bash - From d8ef0f37a325dbc6be58073242cc6b001b48fcbb Mon Sep 17 00:00:00 2001 From: Tlntin Date: Sun, 5 Feb 2023 13:49:10 +0800 Subject: [PATCH 4/4] test git actions --- .github/workflows/pake_build_with_cache.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pake_build_with_cache.yaml b/.github/workflows/pake_build_with_cache.yaml index b9ce8ab..cc9ac7b 100644 --- a/.github/workflows/pake_build_with_cache.yaml +++ b/.github/workflows/pake_build_with_cache.yaml @@ -1,9 +1,6 @@ name: Build App with Cache on: - push: - # Sequence of patterns matched against refs/tags - branches: - - release + workflow_dispatch: {} jobs: build: @@ -142,6 +139,7 @@ jobs: source "$HOME/.cargo/env" export RUST_BACKTRACE=1 npm run build:all-unix + chmod -R 777 /build - name: Upload files env: