Skip to content

Commit 9a7d79d

Browse files
Merge branch 'main' into pr-duckduckgo
2 parents 991625e + 94a3892 commit 9a7d79d

34 files changed

Lines changed: 1864 additions & 1543 deletions

File tree

.github/actions/build/action.yaml

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -20,78 +20,78 @@ inputs:
2020
runs:
2121
using: "composite"
2222
steps:
23-
- uses: actions/checkout@v7
23+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # ratchet:actions/checkout@v7
2424

25-
- uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # ratchet:Swatinem/rust-cache@v2
26-
if: ${{ inputs.container == null }}
25+
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # ratchet:Swatinem/rust-cache@v2
26+
if: ${{ inputs.container == null }}
2727

28-
- uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # ratchet:dtolnay/rust-toolchain@master
29-
if: ${{ inputs.container == null }}
30-
with:
31-
targets: ${{ inputs.rust_target }}
32-
toolchain: "1.85.0"
28+
- uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772 # ratchet:dtolnay/rust-toolchain@master
29+
if: ${{ inputs.container == null }}
30+
with:
31+
targets: ${{ inputs.rust_target }}
32+
toolchain: "1.85.0"
3333

34-
- name: Install Nix
35-
if: ${{ inputs.os_name != 'windows' }}
36-
uses: DeterminateSystems/nix-installer-action@v16
34+
- name: Install Nix
35+
if: ${{ inputs.os_name != 'windows' }}
36+
uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25 # ratchet:DeterminateSystems/nix-installer-action@v22
3737

38-
- name: Build all crates (Linux/MacOS)
39-
shell: bash
40-
if: ${{ inputs.container == null && inputs.os_name != 'windows' }}
41-
run: |
42-
# TODO reproduce packpath folder
43-
# ./scripts/setup-deps.sh clone "deps/start"
38+
- name: Build all crates (Linux/MacOS)
39+
shell: bash
40+
if: ${{ inputs.container == null && inputs.os_name != 'windows' }}
41+
run: |
42+
# TODO reproduce packpath folder
43+
# ./scripts/setup-deps.sh clone "deps/start"
4444
45-
set -x
46-
mkdir -p ~/.cache/nvim
47-
nix develop .#ci --command nvim -V3nvim.log --headless -u NONE --cmd "set rtp^=." -c "runtime plugin/avante.lua" -c "lua vim.g.avante = { debug= vim.log.levels.INFO }" -c "AvanteBuild source=true" +quit!
45+
set -x
46+
mkdir -p ~/.cache/nvim
47+
nix develop .#ci --command nvim -V3nvim.log --headless -u NONE --cmd "set rtp^=." -c "runtime plugin/avante.lua" -c "lua vim.g.avante = { debug= vim.log.levels.INFO }" -c "AvanteBuild source=true" +quit!
4848
49-
# to help diagnose failures
50-
cat nvim.log
51-
ls -lRa lua
49+
# to help diagnose failures
50+
cat nvim.log
51+
ls -la lua
5252
5353
54-
- name: Build all crates (Windows)
55-
if: ${{ inputs.os_name == 'windows' }}
56-
shell: bash
57-
run: |
58-
# TODO run AvanteBuild instead
59-
cargo build --release --features ${{ matrix.feature }} --target ${{ inputs.rust_target }}
54+
- name: Build all crates (Windows)
55+
if: ${{ inputs.os_name == 'windows' }}
56+
shell: bash
57+
run: |
58+
# TODO run AvanteBuild instead
59+
cargo build --release --features ${{ matrix.feature }} --target ${{ inputs.rust_target }}
6060
61-
- name: Build all crates (Linux) with glibc 2.17 # for glibc 2.17
62-
shell: bash
63-
if: ${{ inputs.container != null }}
64-
run: |
65-
# sudo apt-get install -y qemu qemu-user-static
66-
docker run \
67-
--rm \
68-
-v $(pwd):/workspace \
69-
-w /workspace \
70-
--platform ${{ inputs.docker_platform }} \
71-
${{ inputs.container }} \
72-
bash -c "yum install -y perl-IPC-Cmd openssl-devel && curl --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal && . /root/.cargo/env && make ${{ matrix.feature }} BUILD_FROM_SOURCE=true"
61+
- name: Build all crates (Linux) with glibc 2.17 # for glibc 2.17
62+
shell: bash
63+
if: ${{ inputs.container != null }}
64+
run: |
65+
# sudo apt-get install -y qemu qemu-user-static
66+
docker run \
67+
--rm \
68+
-v $(pwd):/workspace \
69+
-w /workspace \
70+
--platform ${{ inputs.docker_platform }} \
71+
${{ inputs.container }} \
72+
bash -c "yum install -y perl-IPC-Cmd openssl-devel && curl --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal && . /root/.cargo/env && make ${{ matrix.feature }} BUILD_FROM_SOURCE=true"
7373
74-
- name: Handle binaries (Linux/MacOS)
75-
if: ${{ inputs.os_name != 'windows' }}
76-
shell: bash
77-
run: |
78-
mkdir -p results
79-
cp -v lua/avante_*.so results/
80-
tar zcvf avante_lib-${{ inputs.os_name }}-${{ inputs.arch }}-${{ matrix.feature }}.tar.gz results/*.so
74+
- name: Handle binaries (Linux/MacOS)
75+
if: ${{ inputs.os_name != 'windows' }}
76+
shell: bash
77+
run: |
78+
mkdir -p results
79+
cp -v lua/avante_*.so results/
80+
tar zcvf avante_lib-${{ inputs.os_name }}-${{ inputs.arch }}-${{ matrix.feature }}.tar.gz results/*.so
8181
82-
- name: Handle binaries (Windows)
83-
if: ${{ inputs.os_name == 'windows' }}
84-
shell: pwsh
85-
run: |
86-
New-Item -ItemType Directory -Force -Path results
82+
- name: Handle binaries (Windows)
83+
if: ${{ inputs.os_name == 'windows' }}
84+
shell: pwsh
85+
run: |
86+
New-Item -ItemType Directory -Force -Path results
8787
88-
$TargetDir = "target\${{ inputs.rust_target }}\release"
89-
Copy-Item -Path "$TargetDir\avante_templates.dll" -Destination "results\avante_templates.dll"
90-
Copy-Item -Path "$TargetDir\avante_tokenizers.dll" -Destination "results\avante_tokenizers.dll"
91-
Copy-Item -Path "$TargetDir\avante_repo_map.dll" -Destination "results\avante_repo_map.dll"
92-
Copy-Item -Path "$TargetDir\avante_html2md.dll" -Destination "results\avante_html2md.dll"
88+
$TargetDir = "target\${{ inputs.rust_target }}\release"
89+
Copy-Item -Path "$TargetDir\avante_templates.dll" -Destination "results\avante_templates.dll"
90+
Copy-Item -Path "$TargetDir\avante_tokenizers.dll" -Destination "results\avante_tokenizers.dll"
91+
Copy-Item -Path "$TargetDir\avante_repo_map.dll" -Destination "results\avante_repo_map.dll"
92+
Copy-Item -Path "$TargetDir\avante_html2md.dll" -Destination "results\avante_html2md.dll"
9393
94-
Set-Location -Path results
94+
Set-Location -Path results
9595
96-
$dllFiles = Get-ChildItem -Filter "*.dll" | Select-Object -ExpandProperty Name
97-
Compress-Archive -Path $dllFiles -DestinationPath "avante_lib-${{ inputs.os_name }}-${{ inputs.arch }}-${{ matrix.feature }}.zip"
96+
$dllFiles = Get-ChildItem -Filter "*.dll" | Select-Object -ExpandProperty Name
97+
Compress-Archive -Path $dllFiles -DestinationPath "avante_lib-${{ inputs.os_name }}-${{ inputs.arch }}-${{ matrix.feature }}.zip"

.github/workflows/rust.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ jobs:
2121
name: Run Rust tests
2222
runs-on: ubuntu-latest
2323
steps:
24-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
25-
- uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # ratchet:Swatinem/rust-cache@v2
26-
- uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # ratchet:dtolnay/rust-toolchain@master
24+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # ratchet:actions/checkout@v7
25+
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # ratchet:Swatinem/rust-cache@v2
26+
# should match the flake toolchain
27+
- uses: dtolnay/rust-toolchain@52699249a776424c51ebc9ee197baf0f9dbf0d8a # ratchet:dtolnay/rust-toolchain@1.86
2728
with:
2829
toolchain: stable
2930
components: clippy, rustfmt
3031
- name: Run rust tests
31-
run: cargo test --features luajit
32+
run: make rusttest

CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ uv pip install py/rag-service
2424

2525
```sh
2626
pre-commit install --install-hooks
27+
rustup component add rustfmt
28+
rustup component add clippy
2729
```
2830

2931
## Tooling configuration
@@ -84,6 +86,11 @@ make luatest
8486

8587
If the previous doesn't work you can check the Makefile targets and run the files in scripts/ with `--live` instead.
8688

89+
# How to bump CI/CD actions
90+
91+
Use [ratchet](https://github.com/sethvargo/ratchet) to upgrade and pin actions
92+
to specific commit. See the 'upgrade-actions' target in Makefile.
93+
8794
# How to create a new release ? (maintainers-only)
8895

8996
1. Create a branch `release-vX.X` if it doesn't exist yet

0 commit comments

Comments
 (0)