Files
daily-counter/.gitea/workflows/test.yaml
John Ahlroos da540ce9a4
Some checks failed
Run Tests / run-tests (push) Failing after 7s
Use python from venv
2026-05-02 11:59:15 +02:00

53 lines
1.6 KiB
YAML

name: Run Tests
on:
push: {}
env:
RUNNER_TOOL_CACHE: /toolcache
jobs:
run-tests:
runs-on: python
container:
image: catthehacker/ubuntu:act-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.SSH_JOHN_PRIVATE_KEY }}
- name: Setup Python
id: setup_python
uses: actions/setup-python@v6
with:
python-version: '3.14.1'
architecture: 'x86'
cache: 'pip'
- name: Restore cached virtualenv
uses: actions/cache/restore@v4
with:
key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('pyproject.toml') }}
path: .venv
- name: Create virtual env
run: |
python3 -m venv .venv
source .venv/bin/activate
which python
python --version
python -m sqlite3 --version
- name: Install poetry
run: |
source .venv/bin/activate
pip install poetry==2.3.4
- name: Install the project dependencies
run: |
source .venv/bin/activate
poetry install
poetry env info
- name: Cache virtual env
uses: actions/cache/save@v4
with:
key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('pyproject.toml') }}
path: .venv
- name: Run the automated tests
run: |
source .venv/bin/activate
poetry run pytest tests