-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (63 loc) · 2.46 KB
/
verify-markdown-guides.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Verify Markdown Giudes
#
# This workflow allows you to run tests for the markdown guides in the repository.
#
# It expects the following:
# - `test` directory in the repository root containing the test configuration file and the test script.
# - `test/requirements.txt` file containing the Python dependencies required to run the tests.
# - `test/test.py` script that runs the tests.
#
on:
workflow_call:
inputs:
test-config-path:
description: |
The path to the test configuration file, relative to the repository root.
::warning:: This is mutually exclusive with `test-file`.
Example: `test/_test_config.yml`
type: string
required: false
test-file:
description: |
The path to the test file, relative to the repository root. This is used to run tests for a specific guide.
::warning:: This is mutually exclusive with `test-config-path` and will take precedence over it.
Example: `billion-scale-vector-search/README.md`
type: string
required: false
defaults:
run:
# Specify to ensure "pipefail and errexit" are set.
# Ref: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#defaultsrunshell
shell: bash
jobs:
test:
runs-on: ubuntu-latest
env:
LANG: "C.UTF-8"
steps:
# Replace when this is merged: https://github.com/vespa-engine/gh-actions/pull/7
# - uses: vespa-engine/gh-actions/github/free-disk-space@main
- uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
with:
tool-cache: "false"
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
- name: Install python dependencies
shell: bash
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -qqq -r test/requirements.txt --user
python3 -m pip install -qqq pytest nbmake --user
- name: Install Vespa CLI
uses: vespa-engine/setup-vespa-cli-action@v1
- name: run-tests (config)
if: ${{ inputs.test-config-path && !inputs.test-file }}
run: |
./test/test.py -w $GITHUB_WORKSPACE -c ${{ inputs.test-config-path }}
- name: run-tests (file)
if: ${{ inputs.test-file && !inputs.test-config-path }}
run: |
./test/test.py -w $GITHUB_WORKSPACE ${{ inputs.test-file }}