Skip to content

ENH - Make conda-docker a dependency in Linux only in pyproject.toml … #1468

ENH - Make conda-docker a dependency in Linux only in pyproject.toml …

ENH - Make conda-docker a dependency in Linux only in pyproject.toml … #1468

Workflow file for this run

name: Tests
env:
DEFAULT_PYTHON_VERSION: "3.10"
on:
pull_request:
push:
branches:
- main
jobs:
test-conda-store-server:
name: "unit-test conda-store-server"
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]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -el {0}
working-directory: conda-store-server
steps:
- name: "Checkout Repository"
uses: actions/checkout@v4
- name: Set up Python
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: Linting Checks
run: |
hatch env run -e dev lint
- name: Release Check
run: |
hatch build
- name: Unit Tests
run: |
pytest tests
integration-test-conda-store-server:
name: "integration-test conda-store-server"
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
working-directory: conda-store-server
steps:
- name: "Checkout Repository"
uses: actions/checkout@v4
- name: Set up Python
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: Install Dependencies
run: |
pip install hatch
sudo apt install wait-for-it -y
- name: Deploy docker-compose
run: |
docker-compose up -d
docker ps
wait-for-it localhost:5432 # postgresql
wait-for-it localhost:9000 # minio
wait-for-it localhost:5000 # conda-store-server
- name: Run Playwright tests
run: |
playwright install
pytest --video on ../tests/test_playwright.py
- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: playwright-tests
path: conda-store-server/test-results
- name: Run integration tests
run: |
export PYTHONPATH=$PYTHONPATH:$PWD
pytest ../tests/test_api.py ../tests/test_metrics.py
- name: Docker logs
if: ${{ failure() }}
run: |
docker-compose logs
test-conda-store:
name: "integration-test conda-store"
runs-on: ubuntu-latest
defaults:
run:
working-directory: conda-store
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- name: "Checkout Repository"
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
pip install hatch
sudo apt install wait-for-it -y
- name: Linting Checks
run: |
hatch env run -e dev lint
- name: Release Check
run: |
hatch build
- name: Deploy docker-compose
run: |
docker-compose up -d
docker ps
wait-for-it localhost:5432 # postgresql
wait-for-it localhost:9000 # minio
wait-for-it localhost:5000 # conda-store-server
- name: Install conda-store for tests
run: |
pip install .
- name: Basic tests not authenticated
run: |
sleep 20
./tests/unauthenticated-tests.sh
- name: Basic tests authenticated
run: |
./tests/authenticated-tests.sh
- name: Test shebang
run: |
export CONDA_STORE_URL=http://localhost:5000/conda-store
export CONDA_STORE_AUTH=basic
export CONDA_STORE_USERNAME=username
export CONDA_STORE_PASSWORD=password
./tests/shebang.sh
- name: Docker logs
if: ${{ failure() }}
run: |
docker-compose logs
build-docker-image:
name: "Build docker images"
runs-on: ubuntu-latest
strategy:
matrix:
docker-image:
- conda-store
- conda-store-server
steps:
- name: "Checkout Repository"
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Lint Dockerfiles
uses: jbergstroem/hadolint-gh-action@v1
with:
dockerfile: ${{ matrix.docker-image }}/Dockerfile
output_format: tty
error_level: 0
- name: Docker Meta
id: meta
uses: crazy-max/ghaction-docker-meta@v5
with:
images: |
quansight/${{ matrix.docker-image }}
tags: |
type=sha
- name: Build docker
uses: docker/build-push-action@v5
with:
context: "${{ matrix.docker-image }}"
file: "${{ matrix.docker-image }}/Dockerfile"
tags: |
${{ steps.meta.outputs.tags }}
push: false
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max