feat: add release-please pipeline #64
Workflow file for this run
This file contains 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: Deployment CI | |
env: | |
TEST_TAG: octivbooker:test | |
on: | |
pull_request: | |
branches: [ master ] | |
workflow_dispatch: | |
jobs: | |
test-and-lint: | |
name: Test & Lint | |
runs-on: ubuntu-latest | |
outputs: | |
PACKAGE_VERSION: ${{ steps.extract_version.outputs.PACKAGE_VERSION }} | |
steps: | |
- | |
name: Checkout code | |
uses: actions/checkout@v4 | |
- | |
name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- | |
name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- | |
name: Install dependencies | |
run: | | |
poetry install | |
- | |
name: Run linting with ruff | |
run: | | |
poetry run ruff check . --fix | |
- | |
name: Run tests | |
run: | | |
poetry run coverage run -m pytest | |
poetry run coverage report -m | |
- | |
name: Export coverage HTML | |
run: | | |
poetry run coverage html -d coverage_html | |
- | |
name: Upload coverage HTML artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report | |
path: coverage_html | |
- | |
name: Extract version from pyproject.toml | |
id: extract_version | |
run: | | |
VERSION=$(grep -Po '(?<=^version = ")[^"]*' ./pyproject.toml) | |
echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_OUTPUT | |
docker-test: | |
name: "Test Build Docker Image" | |
runs-on: ubuntu-latest | |
needs: test-and-lint | |
steps: | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- | |
name: Build and export to Docker | |
uses: docker/build-push-action@v6 | |
with: | |
file: ./poetry.Dockerfile | |
load: true | |
tags: ${{ env.TEST_TAG }} | |
- | |
name: Test Run | |
run: | | |
docker run --env IS_TEST=$IS_TEST --env OCTIV_USERNAME=$OCTIV_USERNAME --rm ${{ env.TEST_TAG }} | |
env: | |
IS_TEST: "True" | |
OCTIV_USERNAME: "Test-mail" |