1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
---
name: Stage
on:
workflow_dispatch:
push:
branches:
- dev
paths:
- src/**
- tests/**
- pyproject.toml
- requirements.txt
env:
MAIN_PY_VER: "3.13"
jobs:
test:
runs-on: ubuntu-latest
environment: staging
name: Stage project
steps:
- name: Checkout sources
uses: actions/checkout@v5
- name: Setup timezone
uses: zcong1993/setup-timezone@v2.0.0
with:
timezone: Asia/Jerusalem
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ env.MAIN_PY_VER }}
- name: Cache pip repository
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ env.MAIN_PY_VER }}
- name: Prepare python environment
run: |
pip install -r requirements.txt
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Cache poetry virtual environment
uses: actions/cache@v4
with:
path: .venv
key: ${{ runner.os }}-poetry-${{ hashFiles('**/pyproject.toml') }}-${{ env.MAIN_PY_VER }}
- name: Install, test with coverage report, and build
run: |
poetry lock
poetry install --no-interaction
poetry run poe test_rep
poetry build
- name: Push to CodeCov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
fail_ci_if_error: true
|