Skip to content

Commit

Permalink
Merge branch 'add-py37-nw-image' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jerith committed Nov 23, 2023
2 parents d3fd6ef + e9f31ab commit d298c3e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 62 deletions.
65 changes: 3 additions & 62 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,72 +7,13 @@ on:
branches:
- develop
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- python_version: "3.8"
variant: buster
test_project: django2
- python_version: "3.9"
variant: buster
test_project: django2
env:
TAG: py${{ matrix.python_version }}-${{ matrix.variant }}
IMAGE: praekeltfoundation/django-bootstrap:py${{ matrix.python_version }}-${{ matrix.variant }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: run tests
run: |
docker build --pull --cache-from "$IMAGE" --build-arg PYTHON_VERSION="${{matrix.python_version}}-${{matrix.variant}}" --tag "$IMAGE" .
docker build -t "mysite:$TAG" --build-arg BASE_IMAGE="$IMAGE" --build-arg PROJECT="${{matrix.test_project}}" tests
pip install -r tests/requirements.txt
pytest -v tests/test.py --django-bootstrap-image="mysite:$TAG"
flake8 gunicorn/config.py
cd tests; flake8
- uses: docker/setup-buildx-action@v2
- name: construct image metadata
uses: docker/metadata-action@v4
id: meta
with:
images: |
praekeltfoundation/django-bootstrap
ghcr.io/praekeltfoundation/docker-django-bootstrap
tags: |
type=pep440,pattern=py{{major}},value=${{matrix.python_version}}
type=raw,value=py${{matrix.python_version}}
type=raw,value=${{matrix.variant}}
type=pep440,pattern=py{{major}}-${{matrix.variant}},value=${{matrix.python_version}}
type=raw,value=py${{matrix.python_version}}-${{matrix.variant}}
- name: login to ghcr
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: login to docker hub
uses: docker/login-action@v2
with:
username: ${{secrets.DOCKER_USERNAME}}
password: ${{secrets.DOCKER_PASSWORD}}
- name: build and push
uses: docker/build-push-action@v4
with:
push: ${{github.event_name != 'pull_request'}}
tags: ${{steps.meta.outputs.tags}}
build-args: |
PYTHON_VERSION=${{matrix.python_version}}-${{matrix.variant}}
build-no-wheelhouse:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python_version: ["3.10", "3.9", "3.8"]
variant: [buster, bullseye]
python_version: ["3.10", "3.9", "3.8", "3.7"]
variant: [bullseye]
test_project: [django2]
env:
TAG: py${{ matrix.python_version }}-${{ matrix.variant }}
Expand Down
2 changes: 2 additions & 0 deletions tests/django2/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@
'django-health-check',
'django-prometheus <2.3',
'psycopg2-binary >=2.7',
# For compat with older celery in Python 3.7
'importlib_metadata < 5.0',
],
)

0 comments on commit d298c3e

Please sign in to comment.