Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): add workflow to verify markdown guides #8

Merged
merged 2 commits into from
Aug 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .github/workflows/verify-markdown-guides.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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 }}
Loading