Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
build: add python 3.11 and python 3.12 ci checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Danyal-Faheem committed May 10, 2024
1 parent bcdc416 commit c823f22
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04]
python-version: [3.8]
python-version: [3.8, 3.11, 3.12]
test-target: [test, quality]

steps:
Expand All @@ -29,17 +29,22 @@ jobs:

- name: Build Docker
run: |
docker-compose -f .github/docker-compose-ci.yml up -d
docker exec ecomworker bash -c "sudo apt update -y; sudo apt install python3-dev -y;"
docker compose -f .github/docker-compose-ci.yml up -d
docker exec ecomworker bash -c "sudo apt-get update -y; sudo apt-get install python${{ matrix.python-version }} python${{ matrix.python-version }}-dev -y;"
- name: Format Python Version
run: |
PYTHON_VERSION=${{ matrix.python-version }}
FORMATTED_VERSION=${PYTHON_VERSION/3./py3}
echo "PYTHON_VERSION=$FORMATTED_VERSION" >> $GITHUB_ENV
- name: Run Tests
env:
TARGETS: ${{ matrix.test-target }}
run: |
docker exec ecomworker bash -c "cd /edx/app/ecomworker/ecomworker && make $TARGETS"
docker exec ecomworker bash -c "cd /edx/app/ecomworker/ecomworker && PYTHON_VERSION=$PYTHON_VERSION make $TARGETS"
- name: Run Coverage
if: matrix.test-target == 'test'
if: matrix.test-target == 'test' && matrix.python-version == '3.8'
run: |
pip install -U codecov
codecov
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PACKAGE = ecommerce_worker
PYTHON_VERSION = py38
PYTHON_VERSION_VAR=$(if $(PYTHON_VERSION),$(PYTHON_VERSION),py312)

help: ## display this help message
@echo "Please use \`make <target>' where <target> is one of"
Expand All @@ -15,7 +15,7 @@ worker: ## start the Celery worker process
celery -A ecommerce_worker worker --app=$(PACKAGE).celery_app:app --loglevel=info --queue=fulfillment,email_marketing

test: requirements_tox ## run unit tests and report on coverage
tox -e ${PYTHON_VERSION}
tox -e ${PYTHON_VERSION_VAR}

quality: requirements_tox ## run pep8 and pylint
tox -e quality
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{38},quality
envlist = py{38, 311, 312},quality
skipsdist = true

[isort]
Expand Down

0 comments on commit c823f22

Please sign in to comment.