renovate: bump python in unit image #314
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: | |
push: | |
branches: | |
- main | |
- renovate/* | |
tags: | |
- v* | |
pull_request: | |
branches: | |
- main | |
jobs: | |
mypy: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
- name: "Set up environment" | |
uses: packetcoders/action-setup-cache-python-poetry@0d0be5577b30d85f3fa2d93a4beeda149520f120 # v1.2.0 | |
with: | |
# renovate: datasource=conda depName=conda-forge/python | |
python-version: "3.12.6" | |
# renovate: datasource=pypi depName=poetry versioning=pep440 | |
poetry-version: "1.8.3" | |
install-args: --all-extras | |
- name: Install root | |
run: poetry run pip install -e . --no-deps | |
- run: | | |
poetry run mypy app | |
test: | |
runs-on: ubuntu-24.04 | |
services: | |
mongo: | |
image: mongo:8 | |
env: | |
MONGO_INITDB_ROOT_USERNAME: root | |
MONGO_INITDB_ROOT_PASSWORD: 12345 | |
MONGODUMP_DIR: /mongodumps | |
volumes: | |
- ${{ github.workspace }}/mongodumps:/mongodumps | |
ports: | |
- 27017:27017 | |
options: --name mongo | |
unit: | |
image: unit:1.33.0-python3.12-slim | |
volumes: | |
- ${{ github.workspace }}/unit:/www | |
ports: | |
- 80:80 | |
options: --name unit | |
defaults: | |
run: | |
working-directory: "src" | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
with: | |
path: src | |
- name: "Set up environment" | |
uses: jvansanten/action-setup-cache-python-poetry@working-directory | |
with: | |
# renovate: datasource=conda depName=conda-forge/python | |
python-version: "3.12.6" | |
# renovate: datasource=pypi depName=poetry versioning=pep440 | |
poetry-version: "1.8.3" | |
install-args: --all-extras | |
working-directory: src | |
- name: Install root | |
run: poetry run pip install -e . --no-deps | |
- name: Populate docker volumes | |
run: | | |
sudo cp -r . ${{ github.workspace }}/unit | |
sudo cp -r tests/test-data/minimongodumps/* ${{ github.workspace }}/mongodumps | |
- name: "Populate test catalog" | |
uses: docker://docker | |
with: | |
args: > | |
docker exec mongo /mongodumps/restore.sh | |
- name: "Configure Unit" | |
uses: docker://docker | |
with: | |
args: > | |
docker exec unit bash -c 'curl | |
http://localhost/config | |
--unix-socket /var/run/control.unit.sock | |
-X PUT | |
-d "$(sed -e "s|\$PYTHON_VERSION|$(python -c "from sys import version_info as v; print(f\"{v.major}.{v.minor}\")")|g" /www/tests/test-data/nginx-unit/config.json)" | |
--fail-with-body | |
- name: Test with pytest | |
run: | | |
poetry run pytest tests --integration | |
env: | |
CATALOGSERVER_URI: http://localhost:80 |