Skip to content

Commit 0f0f1d2

Browse files
esolitosgitbutler-client
authored andcommitted
feat: migrate several "verify-guides" workflow to Github actions
1 parent 1ff9e32 commit 0f0f1d2

File tree

5 files changed

+157
-0
lines changed

5 files changed

+157
-0
lines changed

.github/actions/free-space/action.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Free disk space
2+
description: Frees some disk space on the runner.
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Remove Android library (~14GiB)
8+
shell: bash
9+
run: |
10+
sudo rm -rf /usr/local/lib/android|| true
11+
12+
- name: Remove .Net runtime (~2.7GiB)
13+
shell: bash
14+
run: |
15+
sudo rm -rf /usr/share/dotnet|| true
16+
17+
- name: Remove misc large packages (~5.3GiB)
18+
shell: bash
19+
run: |
20+
sudo apt-get remove -yq --fix-missing --autoremove '^aspnetcore-.*' || true
21+
sudo apt-get remove -yq --fix-missing --autoremove '^dotnet-.*' || true
22+
sudo apt-get remove -yq --fix-missing --autoremove '^llvm-.*' || true
23+
sudo apt-get remove -yq --fix-missing --autoremove '^mongodb-.*' || true
24+
sudo apt-get remove -yq --fix-missing --autoremove '^google-cloud-*' || true
25+
sudo apt-get remove -yq --fix-missing --autoremove php-common php-pear|| true
26+
sudo apt-get remove -yq --fix-missing --autoremove mysql-common || true
27+
sudo apt-get remove -yq --fix-missing --autoremove azure-cli powershell mono-devel libgl1-mesa-dri|| true
28+
sudo apt-get remove -yq --fix-missing --autoremove google-chrome-stable firefox microsoft-edge-stable|| true
29+
sudo apt-get remove -yq --fix-missing --autoremove snapd|| true
30+
sudo apt-get autoremove -yq|| true
31+
sudo apt-get clean|| true
32+
33+
- name: Remove Tool Cache (~5.9GiB)
34+
shell: bash
35+
run: |
36+
sudo rm -rf "$AGENT_TOOLSDIRECTORY"|| true
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "Setup Vespa CLI and dependencies"
2+
description: "Install Vespa CLI and dependencies"
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
# - name: Setup Ruby
8+
# uses: ruby/setup-ruby@v1
9+
# with:
10+
# ruby-version: 3.1
11+
# bundler-cache: true
12+
13+
- uses: actions/setup-java@v4
14+
with:
15+
distribution: "temurin"
16+
java-version: "17"
17+
18+
- name: Install python dependencies
19+
shell: bash
20+
run: |
21+
python3 -m pip install --upgrade pip
22+
python3 -m pip install -qqq -r test/requirements.txt --user
23+
python3 -m pip install -qqq pytest nbmake --user
24+
25+
- name: Install Vespa CLI
26+
uses: vespa-engine/setup-vespa-cli-action@v1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Verify Giudes (billion scale vector search)
2+
3+
on:
4+
workflow_dispatch: # Allow manual triggering of this workflow.
5+
6+
push:
7+
branches: ["master"]
8+
paths:
9+
- "billion-scale-vector-search/"
10+
11+
pull_request:
12+
branches: ["master"]
13+
paths:
14+
- "billion-scale-vector-search/"
15+
16+
jobs:
17+
main:
18+
uses: ./.github/workflows/verify-guides.yml
19+
with:
20+
test-file: "billion-scale-vector-search/README.md"
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Verify Giudes (Main)
2+
3+
on:
4+
workflow_dispatch: # Allow manual triggering of this workflow.
5+
6+
push:
7+
branches: ["master"]
8+
paths-ignore:
9+
- "billion-scale-vector-search/"
10+
- "billion-scale-image-search/"
11+
- "examples/model-deployment/"
12+
13+
pull_request:
14+
branches: ["master"]
15+
paths-ignore:
16+
- "billion-scale-vector-search/"
17+
- "billion-scale-image-search/"
18+
- "examples/model-deployment/"
19+
20+
jobs:
21+
main:
22+
uses: ./.github/workflows/verify-guides.yml
23+
with:
24+
test-config-path: "test/_test_config.yml"

.github/workflows/verify-guides.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Verify Giudes
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
test-config-path:
7+
description: |
8+
The path to the test configuration file, relative to the repository root.
9+
10+
::warning:: This is mutually exclusive with `test-file`.
11+
12+
Example: `test/_test_config.yml`
13+
type: string
14+
required: false
15+
test-file:
16+
description: |
17+
The path to the test file, relative to the repository root. This is used to run tests for a specific guide.
18+
19+
::warning:: This is mutually exclusive with `test-config-path` and will take precedence over it.
20+
21+
Example: `billion-scale-vector-search/README.md`
22+
type: string
23+
required: false
24+
25+
defaults:
26+
run:
27+
# Specify to ensure "pipefail and errexit" are set.
28+
# Ref: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#defaultsrunshell
29+
shell: bash
30+
31+
jobs:
32+
test:
33+
runs-on: ubuntu-latest
34+
env:
35+
LANG: "C.UTF-8"
36+
steps:
37+
- uses: actions/checkout@v4
38+
39+
- uses: ./.github/actions/free-space
40+
41+
- uses: ./.github/actions/install-deps
42+
43+
- name: run-tests (config)
44+
if: ${{ inputs.test-config-path && !inputs.test-file }}
45+
run: |
46+
./test/test.py -w $GITHUB_WORKSPACE -c ${{ inputs.test-config-path }}
47+
48+
- name: run-tests (file)
49+
if: ${{ inputs.test-file && !inputs.test-config-path }}
50+
run: |
51+
./test/test.py -w $GITHUB_WORKSPACE ${{ inputs.test-file }}

0 commit comments

Comments
 (0)