Skip to content

0.0.0

0.0.0 #41

Workflow file for this run

name: Run Tests & Deploy
on: [push]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install poetry && poetry config virtualenvs.create false
python -m venv /opt/venv
poetry install --no-interaction --no-root
- name: Install packages needed for CI
run: pip install pre-commit pytest
- name: Lint all files
run: pre-commit run --all-files --show-diff-on-failure
- name: Run tests
env:
SOURCE_API_BASE: ${{secrets.SOURCE_API_BASE}}
SOURCE_USERNAME: ${{secrets.SOURCE_USERNAME}}
SOURCE_PASSWORD: ${{secrets.SOURCE_PASSWORD}}
TARGET_API_BASE: ${{secrets.TARGET_API_BASE}}
TARGET_USERNAME: ${{secrets.TARGET_USERNAME}}
TARGET_PASSWORD: ${{secrets.TARGET_PASSWORD}}
run: pytest tests
deploy:
runs-on: ubuntu-latest
needs: build-and-test
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.PUBLISH_TOKEN }}
- name: Semantic release
uses: relekang/python-semantic-release@master
with:
# Personal Access Token that belongs to an admin of the repo must
# be set in PUBLISH_TOKEN secret to bypass `main` branch protection
github_token: ${{ secrets.PUBLISH_TOKEN }}