Skip to content

Fix the schema test

Fix the schema test #3

Workflow file for this run

name: tests
on:
push:
branches: [main]
pull_request:
branches: [main]
release:
types: [created]
env:
GHCR_IMAGE_NAME: "ghcr.io/pikhovkin/${GITHUB_REPOSITORY:10}"
IMAGE_NAME: "pikhovkin/${GITHUB_REPOSITORY:10}"
TAG: ${GITHUB_REF:10}
jobs:
test:
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
runs-on: ${{ matrix.os }}
env:
DJANGO_SECRET_KEY: $RANDOM
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest] #, windows-latest, macos-latest]
python-version: ['3.10', '3.11', '3.12']
# django: ['Django>=4.0,<4.1', 'Django>=4.1,<4.2', 'Django>=4.2,<4.3']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install Hatch
run: |
pip install --upgrade pip
pip install hatch
- name: Run Linter
run: hatch run lint:all
- name: Run tests
run: hatch run +py=${{ matrix.python-version }} all:cov
build-package:
if: github.event_name == 'release' && github.event.action == 'created'
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install hatch
- name: Build package
run: hatch build
- name: Publish package
run : |
hatch publish -u __token__ -a ${{ secrets.PYPI_API_TOKEN }}
build-demo:
if: github.event_name == 'release' && github.event.action == 'created'
needs: [test]
runs-on: ubuntu-latest
env:
DJANGO_SETTINGS_MODULE: tests.conf.settings.demo
steps:
- uses: actions/checkout@v3
- name: Docker login
run: echo ${{ secrets.GHCR_TOKEN }} | docker login ghcr.io -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
- name: Build the Docker image
run: |
docker build -f docker/Dockerfile -t ${{ env.GHCR_IMAGE_NAME }}-demo:${{ env.TAG }} .
- name: Docker push
run: |
docker push ${{ env.GHCR_IMAGE_NAME }}-demo:${{ env.TAG }}