From e3fa0691ed109049ac5a4c7375f2f2e85bae75d1 Mon Sep 17 00:00:00 2001 From: MatthieuCoder Date: Wed, 4 Jan 2023 19:39:02 +0400 Subject: [PATCH] move cache before build (i'm stpid) --- .github/workflows/build.yml | 53 ++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aaa42bc..90f5cde 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,6 +40,15 @@ jobs: steps: - uses: actions/checkout@v2 + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - uses: arduino/setup-protoc@v1 with: repo-token: ${{ secrets.GITHUB_TOKEN }} @@ -74,15 +83,7 @@ jobs: with: name: macos path: artifacts/* - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + build_windows: name: 'Build for Windows' @@ -94,10 +95,20 @@ jobs: steps: - uses: actions/checkout@v2 + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - uses: msys2/setup-msys2@v2 with: install: git mingw-w64-x86_64-go mingw-w64-x86_64-make mingw-w64-x86_64-protobuf mingw-w64-x86_64-rust mingw-w64-x86_64-gcc mingw-w64-x86_64-dlfcn - + - name: Build run: | cargo build --release @@ -120,6 +131,13 @@ jobs: with: name: windows path: artifacts/* + + build_linux: + name: 'Build for Linux' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 - uses: actions/cache@v3 with: path: | @@ -130,12 +148,6 @@ jobs: target/ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - build_linux: - name: 'Build for Linux' - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - uses: arduino/setup-protoc@v1 with: repo-token: ${{ secrets.GITHUB_TOKEN }} @@ -167,12 +179,3 @@ jobs: with: name: linux_glibc path: artifacts/* - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} -- 2.39.5