Skip to content

translations & links #95

translations & links

translations & links #95

Workflow file for this run

name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
tox:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: mysecretpassword
POSTGRES_USER: kitamanager
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
matrix:
python: ["3.10", "3.12"]
steps:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install tox and any other packages
run: pip install tox
- uses: actions/checkout@v2
- name: Run tox
run: |
# the content of the dev-progres env vars must match what is set wtih POSTGRES_{PASSWORD,USER}
source kitamanager-env-dev-postgres
tox
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# both required for setuptools_scm to produce a correct version
fetch-depth: 0
fetch-tags: true
# https://github.com/actions/checkout#checkout-pull-request-head-commit-instead-of-merge-commit
ref: ${{ github.event.pull_request.head.sha }}
- name: Set django-kitamanager version env
run: |
pip install --upgrade pip setuptools setuptools_scm
echo "DJANGO_KITAMANAGER_VERSION=$(cd django-kitamanager && python -m setuptools_scm)" >> $GITHUB_ENV
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/eenemeene/kitamanager
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
build-args: |
"VERSION=${{ env.DJANGO_KITAMANAGER_VERSION }}"
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}