2023-11-19 12:17:56 +00:00
|
|
|
# Verify that the `TESTS_SKIP_REQUIRES_DOCKER` environment variable works
|
|
|
|
# Or in other words:
|
|
|
|
# Verify that all tests that require Docker have the @requires_docker decorator
|
|
|
|
|
2023-11-20 18:46:54 +00:00
|
|
|
name: Unit tests without Docker
|
2023-11-19 12:17:56 +00:00
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
schedule:
|
|
|
|
- cron: '0 1 * * *' # every day at 1AM
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
python-version: ["3.11"]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
2023-12-11 23:47:25 +00:00
|
|
|
uses: actions/setup-python@v5
|
2023-11-19 12:17:56 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Update pip
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
- name: Install project dependencies
|
|
|
|
run: |
|
|
|
|
pip install -r requirements-dev.txt
|
|
|
|
pip install pytest-github-actions-annotate-failures
|
|
|
|
# We should be skipping all tests that require Docker
|
|
|
|
# Uninstalling the module enforces that all tests are indeed skipped
|
|
|
|
- name: Uninstall Docker
|
|
|
|
run: |
|
2023-11-20 18:46:54 +00:00
|
|
|
sudo systemctl stop docker
|
|
|
|
sudo systemctl stop docker.socket
|
2023-11-19 12:17:56 +00:00
|
|
|
- name: Test with pytest
|
|
|
|
env:
|
|
|
|
TESTS_SKIP_REQUIRES_DOCKER: true
|
|
|
|
run: |
|
|
|
|
pytest tests
|