Files
Anthias/.github/workflows/test-runner.yml
dependabot[bot] 9fa0da6528 chore(deps): bump the github-actions group with 2 updates (#2490)
Bumps the github-actions group with 2 updates: [actions/setup-python](https://github.com/actions/setup-python) and [actions/setup-node](https://github.com/actions/setup-node).


Updates `actions/setup-python` from 5 to 6
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5...v6)

Updates `actions/setup-node` from 4 to 5
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/setup-node
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-04 11:00:38 -07:00

96 lines
2.6 KiB
YAML

name: Test Runner
on:
workflow_call:
inputs:
test-type:
description: 'Type of tests to run (typescript or python)'
required: true
type: string
python-version:
description: 'Python version to use'
required: false
default: '3.11'
type: string
jobs:
run-tests:
name: Run ${{ inputs.test-type }} tests
runs-on: ubuntu-24.04
env:
COMPOSE_FILE: docker-compose.test.yml
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version }}
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.3
virtualenvs-create: true
virtualenvs-in-project: false
virtualenvs-path: ~/.venv
installer-parallel: true
- name: Install dependencies
run: |
poetry install --only=docker-image-builder
- name: Build Containers
run: |
poetry run python -m tools.image_builder \
--dockerfiles-only \
--disable-cache-mounts \
--service celery \
--service redis \
--service test
- name: Start the test container
run: |
docker compose up -d --build
- name: Run TypeScript tests
if: inputs.test-type == 'typescript'
run: |
docker compose exec anthias-test \
npm install
docker compose exec anthias-test \
npm run test
- name: Run Python unit tests
if: inputs.test-type == 'python'
run: |
docker compose exec anthias-test \
./manage.py test --noinput --parallel --exclude-tag=integration
- name: Setup integration test environment
if: inputs.test-type == 'python'
run: |
docker compose exec anthias-test \
bash ./bin/prepare_test_environment.sh -s
- name: Run Python integration tests
if: inputs.test-type == 'python'
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
command: |
docker compose exec anthias-test \
./manage.py test --noinput --tag=integration
- name: Upload coverage reports to Codecov
if: inputs.test-type == 'python'
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Stop the test container
run: |
docker compose down