ci: initial cicd workflows #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit tests | |
on: | |
pull_request: | |
branches: [ main ] | |
jobs: | |
unit-tests: | |
if: ${{ (github.event.repository.visibility == 'public') && (github.repository_owner == 'intel') }} | |
name: Run unit tests | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
path: repo | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Install test prerequisites | |
run: sudo apt-get update && sudo apt-get -y install libgl1-mesa-glx tox | |
- name: Trigger unit tests | |
run: | | |
echo "Attempting to run unit tests" | |
cd repo/src | |
tox -e embeddings_unit_tests,llms_unit_tests,dataprep_unit_tests,ingestion_unit_tests,prompt_registry_unit_tests,retrievers_unit_tests,reranks_unit_tests,vectorstores_unit_tests,llm_guard_input_guardrail_unit_tests,llm_guard_output_guardrail_unit_tests | |
exit_code=$? | |
echo "Unit tests finished" | |
exit $exit_code |