tests: include more tests #401
Workflow file for this run
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: main | |
| on: [push, pull_request] | |
| jobs: | |
| tests: | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: ${{ (matrix.os == 'windows-latest' && 45) || 15 }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| python-version: ["3.10", "3.11", "3.12"] | |
| concurrency: | |
| group: ci-tests-${{ matrix.os }}-${{ matrix.python-version }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| shell: bash | |
| run: | | |
| pip install poetry poetry-plugin-export | |
| poetry config virtualenvs.create false | |
| if [ "${{ runner.os }}" = "Linux" ]; then | |
| poetry install --without dev | |
| pip install pre-commit | |
| else | |
| poetry install --without dev | |
| fi | |
| pip install pytest pytest-timeout pytest-retry pytest-asyncio pytest-cov | |
| - name: Linting | |
| if: matrix.os == 'ubuntu-latest' | |
| shell: bash | |
| run: pre-commit run --files pysus/**/* | |
| - name: Tests (Linux) | |
| if: matrix.os != 'windows-latest' | |
| shell: bash | |
| run: | | |
| poetry run pytest -vv pysus/tests/ --retries 3 --retry-delay 15 --cov=pysus --cov-report=xml:coverage.xml --cov-report=term-missing | |
| - name: Tests (Windows) | |
| if: matrix.os == 'windows-latest' | |
| shell: bash | |
| run: | | |
| export DUCKDB_NO_THREADS=1 | |
| poetry run pytest -vv pysus/tests/ --timeout=480 -p no:cacheprovider | |
| - name: Upload coverage to Codecov | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: ./coverage.xml | |
| fail_ci_if_error: false | |
| docker-tests: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build Docker image | |
| run: docker compose -f docker/docker-compose.yaml build | |
| - name: Start container | |
| run: docker compose -f docker/docker-compose.yaml up -d | |
| - name: Wait for Jupyter | |
| run: | | |
| for i in $(seq 1 10); do | |
| curl -s -o /dev/null http://127.0.0.1:8888 && break | |
| sleep 2 | |
| done | |
| - name: Run tests inside container | |
| run: docker compose -f docker/docker-compose.yaml exec -T -w /usr/src jupyter python3 -m pytest -vv pysus/tests/ --retries 3 --retry-delay 15 -x -o cache_dir=/tmp/.pytest_cache | |
| - name: Cleanup | |
| if: always() | |
| run: docker compose -f docker/docker-compose.yaml down -v |