Skip to content

Commit

Permalink
update setup conda on ci
Browse files Browse the repository at this point in the history
  • Loading branch information
xmnlab committed Apr 18, 2024
1 parent 9f02c2c commit 9148a71
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,29 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 30
timeout-minutes: 10
strategy:
matrix:
python_version: ["3.10"]
concurrency:
group: ci-${{ github.ref }}
group: ci-deploy-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: conda-incubator/setup-miniconda@v2
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
mamba-version: "*"
environment-file: conda/base.yaml
channels: conda-forge,nodefaults
activate-environment: celery-collectors
use-mamba: true
miniforge-variant: Mambaforge
activate-environment: poc-celery
auto-update-conda: true
conda-solver: libmamba

- name: Prepare path
run: mkdir -p "data/"
Expand All @@ -46,8 +45,7 @@ jobs:
run: celery -A main.celery_app worker --loglevel=DEBUG &

- name: Run pytest for Collectors
run: pytest -vvv main/tests/tests_tasks_collectors.py

run: pytest -vvv test_tasks_collectors.py

- name: Run pytest for Async tasks
run: pytest -vvv main/tests/tests_tasks_async.py
run: pytest -vvv test_tasks_async.py
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ This workflow demonstrates the power of Celery for handling complex asynchronous
3. Activate the new environment:

```bash
mamba activate celery-collectors
mamba activate poc-celery
```

### RabbitMQ and Redis Setup Using Docker
Expand Down
4 changes: 2 additions & 2 deletions conda/base.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: celery-collectors
name: poc-celery
channels:
- nodefaults
- conda-forge
Expand All @@ -10,6 +10,6 @@ dependencies:
- rabbitmq
- redis
- pytest
- pytest-celery
- pytest-celery
- factory_boy
- pytest-asyncio
2 changes: 1 addition & 1 deletion main/celery_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# Create a Celery instance with Rabbitmq as the broker and result backend
app = Celery(
'celery-collectors',
'poc-celery',
broker=f'amqp://guest:guest@{AMQP_IP}:5672',
backend=f'redis://{REDIS_IP}:6379/0',
include=[
Expand Down

0 comments on commit 9148a71

Please sign in to comment.