From 81cef15e5b6b75b86e729304ee42f150fa96013c Mon Sep 17 00:00:00 2001 From: rsdy Date: Fri, 22 Sep 2023 17:10:00 +0200 Subject: [PATCH] Node20 GitHub actions (#980) * Update CI * Tentatively add rust-cache back * Use direnv-action * Test new commit --- .github/workflows/build-on-pr-command.yml | 2 +- .github/workflows/client-test.yml | 4 +- .github/workflows/dependencies.yml | 2 +- .github/workflows/server-test.yml | 64 +++++++++-------------- .github/workflows/tauri-release.yml | 18 ++++++- .github/workflows/tauri-test.yml | 34 ++++++++++-- .github/workflows/validate.yml | 2 +- 7 files changed, 76 insertions(+), 50 deletions(-) diff --git a/.github/workflows/build-on-pr-command.yml b/.github/workflows/build-on-pr-command.yml index 7509dea289..4b8f405b5d 100644 --- a/.github/workflows/build-on-pr-command.yml +++ b/.github/workflows/build-on-pr-command.yml @@ -50,7 +50,7 @@ jobs: id: comment-branch - name: Checkout PR branch - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ steps.comment-branch.outputs.head_ref }} diff --git a/.github/workflows/client-test.yml b/.github/workflows/client-test.yml index 6253a45ef1..a6ecb4692b 100644 --- a/.github/workflows/client-test.yml +++ b/.github/workflows/client-test.yml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -43,4 +43,4 @@ jobs: run: npm run lint - name: Run type-check - run: npm run client-type-check \ No newline at end of file + run: npm run client-type-check diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index f36391eeda..dafd7b36e1 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -55,7 +55,7 @@ jobs: - name: Build qdrant env: - VERSION: 1.3.2 + VERSION: 1.5.1 run: | cargo install --target ${{ matrix.target }} --git https://github.com/qdrant/qdrant --tag v${{ env.VERSION }} --locked --root . qdrant - name: Upload binaries diff --git a/.github/workflows/server-test.yml b/.github/workflows/server-test.yml index 7450c27d89..23109fdc59 100644 --- a/.github/workflows/server-test.yml +++ b/.github/workflows/server-test.yml @@ -19,54 +19,40 @@ jobs: runs-on: nixos steps: - name: Checkout code - uses: nschloe/action-cached-lfs-checkout@v1 + uses: actions/checkout@v4 with: token: ${{ secrets.GITHUB_TOKEN }} - - name: Git LFS + - name: Create LFS file list + run: git lfs ls-files --long | cut -d ' ' -f1 | sort > .lfs-assets-id + + - name: LFS Cache + uses: actions/cache@v3 + with: + path: .git/lfs/objects + key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }} + restore-keys: | + ${{ runner.os }}-lfs- + + - name: Git LFS Pull run: git lfs install && git lfs pull + - name: Load PATH changes + run: direnv allow && direnv exec . sh -c 'echo $PATH' > "$GITHUB_PATH" + + - name: Load other environment changes + run: direnv export gha >> "$GITHUB_ENV" + + - uses: Swatinem/rust-cache@v2 + - name: Rustfmt - run: nix develop -c bash -c 'cargo --locked fmt -p bleep -- --check' + run: cargo --locked fmt -p bleep -- --check - name: Clippy - run: nix develop -c bash -c 'cargo --locked clippy -p bleep --features=ee' + run: cargo --locked clippy -p bleep --features=ee - name: Tests - run: nix develop -c bash -c 'cargo --locked test -p bleep --release' + run: cargo --locked test -p bleep --release - name: Sccache stats - run: nix develop -c bash -c 'sccache --show-stats' - - # benchmark: - # runs-on: [self-hosted, benchmark] - # steps: - # - uses: actions/checkout@v3 - # with: - # clean: false - # lfs: true - - # - name: Setup Rust toolchain - # uses: actions-rs/toolchain@v1 - # with: - # profile: minimal - # toolchain: stable - # override: true - - # - uses: boa-dev/criterion-compare-action@v3.2.4 - # env: - # BLOOP_LOG: bleep=debug - # with: - # cwd: ./server - # benchName: "indexes" - # branchName: ${{ github.base_ref }} - # token: ${{ secrets.GITHUB_TOKEN }} - - # - uses: boa-dev/criterion-compare-action@v3.2.4 - # env: - # BLOOP_LOG: bleep=debug - # with: - # cwd: ./server - # benchName: "queries" - # branchName: ${{ github.base_ref }} - # token: ${{ secrets.GITHUB_TOKEN }} + run: sccache --show-stats diff --git a/.github/workflows/tauri-release.yml b/.github/workflows/tauri-release.yml index cd4fd70145..6b6f564b06 100644 --- a/.github/workflows/tauri-release.yml +++ b/.github/workflows/tauri-release.yml @@ -36,7 +36,23 @@ jobs: steps: - name: Checkout code - uses: nschloe/action-cached-lfs-checkout@v1 + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Create LFS file list + run: git lfs ls-files --long | cut -d ' ' -f1 | sort > .lfs-assets-id + + - name: LFS Cache + uses: actions/cache@v3 + with: + path: .git/lfs/objects + key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }} + restore-keys: | + ${{ runner.os }}-lfs- + + - name: Git LFS Pull + run: git lfs install && git lfs pull - name: Install Protoc uses: arduino/setup-protoc@v2 diff --git a/.github/workflows/tauri-test.yml b/.github/workflows/tauri-test.yml index 76f6268c36..ff00f8714d 100644 --- a/.github/workflows/tauri-test.yml +++ b/.github/workflows/tauri-test.yml @@ -20,16 +20,40 @@ jobs: runs-on: nixos steps: - name: Checkout code - uses: nschloe/action-cached-lfs-checkout@v1 + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Create LFS file list + run: git lfs ls-files --long | cut -d ' ' -f1 | sort > .lfs-assets-id + + - name: LFS Cache + uses: actions/cache@v3 + with: + path: .git/lfs/objects + key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }} + restore-keys: | + ${{ runner.os }}-lfs- + + - name: Git LFS Pull + run: git lfs install && git lfs pull + + - name: Load PATH changes + run: direnv allow && direnv exec . sh -c 'echo $PATH' > "$GITHUB_PATH" + + - name: Load other environment changes + run: direnv export gha >> "$GITHUB_ENV" + + - uses: Swatinem/rust-cache@v2 - name: Rustfmt - run: nix develop -c bash -c 'cargo --locked fmt -p bloop -- --check' + run: cargo --locked fmt -p bloop -- --check - name: Clippy - run: nix develop -c bash -c 'cargo --locked clippy -p bloop' + run: cargo --locked clippy -p bloop - name: Tests - run: nix develop -c bash -c 'cargo --locked test -p bloop --release' + run: cargo --locked test -p bloop --release - name: Sccache stats - run: nix develop -c bash -c 'sccache --show-stats' + run: sccache --show-stats diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 026bc3dfb1..5d638dd882 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0