Skip to content

Add tests for poetry #14

Add tests for poetry

Add tests for poetry #14

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
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@v3
- name: Build Docker Image
run: |
docker build --target test -t test-image \
--build-arg POETRY_VERSION=${{ env.POETRY_VERSION }} \
.
- name: Run Tests in Docker
run: |
docker run --rm \
-e POETRY_VERSION=${{ env.POETRY_VERSION }} \
test-image python3 tests.py
- name: Log in to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v3.1.0
with:
context: .
push: true
tags: ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ github.sha }}-${{ matrix.python }}-${{ matrix.variant }}
build-args: |
POETRY_VERSION=${{ env.POETRY_VERSION }}