[project][ENG-7225][ENG-8319] share clean(up)grade 2025 (milestone 2: upgrade) #941
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_share_tests | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
permissions: | |
checks: write # for coveralls | |
jobs: | |
run_tests: | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ['3.13'] | |
postgres-version: ['17'] | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:${{ matrix.postgres-version }} | |
env: | |
POSTGRES_PASSWORD: postgres | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
elasticsearch8: | |
image: elasticsearch:8.7.0 | |
env: | |
xpack.security.enabled: false | |
node.name: singlenode | |
cluster.initial_master_nodes: singlenode | |
ports: | |
- 9208:9200 | |
rabbitmq: | |
image: rabbitmq:management | |
ports: | |
- 5672:5672 | |
- 15672:15672 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install non-py dependencies | |
run: sudo apt-get update && sudo apt-get install -y libxml2-dev libxslt1-dev libpq-dev git gcc | |
- name: Install poetry | |
run: pipx install poetry | |
- name: setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'poetry' | |
- name: install despondencies | |
run: poetry install --with dev | |
- name: flake it | |
run: poetry run flake8 . | |
- name: run tests | |
run: | | |
poetry run coverage run -m pytest --create-db -x | |
poetry run coverage xml -o _shtrove_coverage.xml | |
env: | |
DATABASE_PASSWORD: postgres | |
ELASTICSEARCH8_URL: http://localhost:9208/ | |
- name: coveralls | |
uses: coverallsapp/github-action@v2 | |
with: | |
file: _shtrove_coverage.xml | |
fail-on-error: false |