2022-01-29 21:31:27 +00:00
|
|
|
name: test
|
2021-09-30 11:36:00 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- 'master'
|
2022-07-31 23:30:23 +00:00
|
|
|
paths:
|
2023-02-14 20:50:51 +00:00
|
|
|
- src/khoj/**
|
2022-07-31 23:30:23 +00:00
|
|
|
- tests/**
|
|
|
|
- config/**
|
2023-02-16 09:12:04 +00:00
|
|
|
- pyproject.toml
|
2023-02-17 18:07:59 +00:00
|
|
|
- .pre-commit-config.yml
|
2022-07-31 23:30:23 +00:00
|
|
|
- .github/workflows/test.yml
|
2021-09-30 11:36:00 +00:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'master'
|
2022-07-31 23:30:23 +00:00
|
|
|
paths:
|
2023-02-14 20:50:51 +00:00
|
|
|
- src/khoj/**
|
2022-07-31 23:30:23 +00:00
|
|
|
- tests/**
|
|
|
|
- config/**
|
2023-02-16 09:12:04 +00:00
|
|
|
- pyproject.toml
|
2023-02-17 18:07:59 +00:00
|
|
|
- .pre-commit-config.yml
|
2022-07-31 23:30:23 +00:00
|
|
|
- .github/workflows/test.yml
|
2021-09-30 11:36:00 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
2022-08-03 18:50:20 +00:00
|
|
|
name: Run Tests
|
2022-08-03 17:00:37 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-02-07 00:05:34 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
python_version:
|
2023-02-07 05:57:42 +00:00
|
|
|
- '3.9'
|
|
|
|
- '3.10'
|
2023-06-29 21:54:51 +00:00
|
|
|
- '3.11'
|
2023-02-07 05:57:42 +00:00
|
|
|
steps:
|
2022-08-03 17:00:37 +00:00
|
|
|
- uses: actions/checkout@v3
|
2023-08-17 02:55:46 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-12-15 06:15:49 +00:00
|
|
|
|
2023-02-07 00:05:34 +00:00
|
|
|
- name: Set up Python
|
2022-08-03 17:00:37 +00:00
|
|
|
uses: actions/setup-python@v4
|
2021-09-30 11:36:00 +00:00
|
|
|
with:
|
2023-02-07 00:05:34 +00:00
|
|
|
python-version: ${{ matrix.python_version }}
|
2021-12-15 06:15:49 +00:00
|
|
|
|
2023-03-01 16:56:39 +00:00
|
|
|
- name: ⏬️ Install Dependencies
|
2022-08-03 17:00:37 +00:00
|
|
|
run: |
|
2023-01-11 19:51:16 +00:00
|
|
|
sudo apt update && sudo apt install -y libegl1
|
2022-08-03 17:00:37 +00:00
|
|
|
python -m pip install --upgrade pip
|
2022-08-03 19:37:16 +00:00
|
|
|
|
2023-03-01 16:56:39 +00:00
|
|
|
- name: ⬇️ Install Application
|
2023-02-17 18:07:59 +00:00
|
|
|
run: pip install --upgrade .[dev]
|
|
|
|
|
2023-03-01 16:56:39 +00:00
|
|
|
- name: 🌡️ Validate Application
|
2023-02-17 20:29:12 +00:00
|
|
|
run: pre-commit run --hook-stage manual --all
|
2021-12-15 06:15:49 +00:00
|
|
|
|
2023-03-01 16:56:39 +00:00
|
|
|
- name: 🧪 Test Application
|
2023-02-17 18:07:59 +00:00
|
|
|
run: pytest
|
2023-08-17 02:55:46 +00:00
|
|
|
timeout-minutes: 10
|