Skip to content

Add approved tribalwars.net script collect troops #1489

Add approved tribalwars.net script collect troops

Add approved tribalwars.net script collect troops #1489

Workflow file for this run

name: Run pytest based tests
on:
push:
branches:
- "**"
tags-ignore:
- "*.*"
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12.6"]
services:
postgres:
image: postgres:16
env:
POSTGRES_PASSWORD: postgres
POSTGRES_INITDB_ARGS: --no-sync
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: false
virtualenvs-path: /opt/venv
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: /opt/venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
- name: Install dependencies and actiavte virtualenv
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
poetry install --no-interaction --no-root
- name: Create .env file from example env file
run: |
cp .env.example .env
- name: Coverage full tests
env:
POSTGRES_HOST: localhost
run: |
poetry run bash scripts/initial.sh
poetry run pytest
- name: Upload coverage result to Codecov
uses: codecov/codecov-action@v4
with:
flags: unittests
file: coverage.xml
fail_ci_if_error: false