Skip to content

Commit

Permalink
ENH - Add a macOS worker to the CI (#550)
Browse files Browse the repository at this point in the history
* Add a macOS worker to the CI

This is built on #549 but
I've made in a separate PR because I'm not sure if there will be other issues
here and I don't want to block that PR on this (but at the same time, tests
won't pass on Mac without the changes from that PR).

See #513 and #507

* Trigger build

* Try not using mamba to fix macos CI

* Add a separate macos environment file without conda-docker

* Use the macos environment file for macos on CI

* Try using mamba on macos again

* Revert "Try using mamba on macos again"

This reverts commit 031574a.

* Install mamba in the dev environment

* Go back to using mamba but with the correct syntax this time

Revert "Revert "Try using mamba on macos again""

This reverts commit 6cf2877.

* Fix CI

Revert "Go back to using mamba but with the correct syntax this time"

This reverts commit b82c0c8.

* Only test docker on Linux
  • Loading branch information
asmeurer authored Oct 9, 2023
1 parent 64552a2 commit 0f26920
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 5 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ jobs:
strategy:
matrix:
# cannot run on windows due to needing fake-chroot for conda-docker
# osx takes forever to get a scheduled job
os: [ubuntu-latest]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
Expand All @@ -26,14 +25,23 @@ jobs:
- name: "Checkout Repository"
uses: actions/checkout@v4

- name: Set up Python
- name: Set up Python (Linux)
if: matrix.os == 'ubuntu-latest'
uses: conda-incubator/setup-miniconda@v2
with:
mamba-version: "*"
activate-environment: conda-store-server-dev
environment-file: conda-store-server/environment-dev.yaml
auto-activate-base: false

- name: Set up Python (macOS)
if: matrix.os == 'macos-latest'
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: conda-store-server-dev
environment-file: conda-store-server/environment-macos-dev.yaml
auto-activate-base: false

- name: Linting Checks
run: |
hatch env run -e dev lint
Expand Down
56 changes: 56 additions & 0 deletions conda-store-server/environment-macos-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: conda-store-server-dev
channels:
- conda-forge
- Microsoft
dependencies:
- python ==3.10
# conda builds
- conda ==23.5.2
- python-docker
- conda-pack
- conda-lock >=1.0.5
- mamba
- conda-package-handling
# web server
- celery
- flower
- redis-py
- sqlalchemy<=1.4.47
- psycopg2
- pymysql
- requests
- uvicorn
- fastapi
- pydantic < 2.0
- pyyaml
- traitlets
- yarl
- pyjwt
- filelock
- itsdangerous
- jinja2
- python-multipart
- alembic
# artifact storage
- minio
# CLI
- typer

# dev dependencies
- hatch
- pytest
- pytest-celery
- pytest-mock
- black ==22.3.0
- flake8
- ruff
- sphinx
- myst-parser
- sphinx-panels
- sphinx-copybutton
- pydata-sphinx-theme
- playwright
- docker-compose

- pip:
- pytest-playwright
7 changes: 5 additions & 2 deletions conda-store-server/tests/test_app_api.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import sys

from celery.result import AsyncResult
from conda_store_server import api, schema

Expand Down Expand Up @@ -67,8 +69,9 @@ def test_conda_store_register_environment_workflow(db, conda_store, celery_worke
task = AsyncResult(f"build-{build.id}-conda-pack")
task.wait(timeout=60)

task = AsyncResult(f"build-{build.id}-docker")
task.wait(timeout=2 * 60)
if sys.platform == "linux":
task = AsyncResult(f"build-{build.id}-docker")
task.wait(timeout=2 * 60)

db.expire_all()
assert build.status == schema.BuildStatus.COMPLETED
Expand Down

0 comments on commit 0f26920

Please sign in to comment.