Skip to content

Add tests for poetry #16

Add tests for poetry

Add tests for poetry #16

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
env:
POETRY_VERSION: 1.7.1
GHCR_IMAGE_REPOSITORY: ghcr.io/${{ github.repository_owner }}/poetry
PLATFORMS: linux/amd64,linux/arm64/v8
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
variant:
- bookworm
- slim
steps:
- uses: actions/checkout@v4.1.1
- name: Build Docker Image
uses: docker/build-push-action@v5.1.0
with:
context: .
push: false
tags: test-image
build-args: POETRY_VERSION=${{ env.POETRY_VERSION }}
- name: Run Tests in Docker
run: |
docker run --rm \
-e POETRY_VERSION=${{ env.POETRY_VERSION }} \
test-image python3 /usr/src/app/tests.py
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v5.1.0
with:
context: .
push: true
tags: ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ github.sha }}-${{ matrix.python }}-${{ matrix.variant }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: ${{ env.PLATFORMS }}
build-args: |
POETRY_VERSION=${{ env.POETRY_VERSION }}
PYTHON_VERSION=${{ matrix.python }}
VARIANT=${{ matrix.variant }}