Skip to content

Enable unit tests in GitHub Actions #14

Enable unit tests in GitHub Actions

Enable unit tests in GitHub Actions #14

Workflow file for this run

name: Fly Deploy
on:
push:
branches:
- main
jobs:
pre-deploy-test:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade
pip install poetry
poetry install --no-interaction --no-ansi --dev
- name: Test with pytest
run: pip install pytest pytest-cov
pytest tests.py --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
deploy:
name: Deploy app
runs-on: ubuntu-latest
concurrency: deploy-group # optional: ensure only one action runs at a time
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}