Update Python #1402
This file contains hidden or 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: Run Tekst-API tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| # paths: | |
| # - "Tekst-API/**" | |
| # - "dev/**" | |
| # - ".github/workflows/api-tests.yml" | |
| workflow_dispatch: | |
| env: | |
| CI: true | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./Tekst-API | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "0.11.2" | |
| enable-cache: true | |
| - name: Install Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version-file: "./Tekst-API/pyproject.toml" | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Configure sysctl limits for ES | |
| run: | | |
| sudo swapoff -a | |
| sudo sysctl -w vm.swappiness=1 | |
| sudo sysctl -w fs.file-max=262144 | |
| sudo sysctl -w vm.max_map_count=262144 | |
| - name: Create SSL cert for emails | |
| run: cd ../dev/smtp-ssl && ./generate.sh | |
| - name: Start test service stack | |
| run: | | |
| docker compose -f ../dev/compose.yml --profile test -p tekst-test up --detach | |
| printf "Waiting for MongoDB service"; sleep 2; printf "\n" | |
| printf "Waiting for Elasticsearch service"; while ! $(curl -f 127.0.0.1:9200 > /dev/null 2>&1); do sleep 1; printf "."; done; printf "\n" | |
| - name: Cancel on setup error | |
| if: failure() | |
| uses: andymckay/cancel-action@0.5 | |
| - name: Run tests | |
| if: always() | |
| env: | |
| TEKST_CUSTOM_ENV_FILE: .env.test | |
| run: uv run pytest && uv run coverage lcov | |
| - name: Coveralls | |
| uses: coverallsapp/github-action@v2 | |
| continue-on-error: true |