Skip to content

Fix CI

Fix CI #470

Workflow file for this run

name: main
on:
push:
pull_request:
workflow_dispatch:
inputs:
ramp_workflow_url:
description: 'pip installable ramp-workflow repo URL'
required: true
default: 'https://github.com/paris-saclay-cds/ramp-workflow/archive/refs/heads/master.zip'
jobs:
main:
name: test-py-${{ matrix.python }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
python: ["3.8", "3.9", "3.10"]
include:
- os: ubuntu-20.04
python: 3.9
# the following has no effect with manual trigger
# where the ramp-workflow is specified anyway
ramp_workflow_version: master
# Do not ignore bash profile files. From:
# https://github.com/marketplace/actions/setup-miniconda
defaults:
run:
shell: bash -l {0}
services:
postgres:
image: postgres:11.6-alpine
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ""
# Add a health check
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v3
- name: Setup conda
uses: conda-incubator/setup-miniconda@v2
with:
#mamba-version: "*"
channels: conda-forge
activate-environment: testenv
environment-file: environment.yml
miniforge-variant: Mambaforge
miniforge-version: latest
python-version: ${{ matrix.python }}
- name: Create iris_kit env
run: |
mamba env create -f ci_tools/environment_iris_kit.yml
- name: Install ramp-board
run: |
conda activate testenv
if [ "$PYTHON_VERSION" == "3.8" ]; then
python -m pip install "dask==2021.4.1" "distributed==2021.4.1"
fi
if [ "${{ matrix.ramp_workflow_version }}" == "master" ]; then
pip install https://github.com/paris-saclay-cds/ramp-workflow/archive/refs/heads/master.zip
fi
if [ "${{ github.event.inputs.ramp_workflow_url }}" != "" ]; then
pip install "${{ github.event.inputs.ramp_workflow_url }}"
fi
make inplace
env:
PYTHON_VERSION: ${{ matrix.python }}
- name: Test ramp-frontend
run: |
set -e
conda activate testenv
python -m smtpd -n -c DebuggingServer 127.0.0.1:8025 &
sleep 3 # wait for the server to start
pytest -rvsl ramp-frontend --cov=ramp_frontend --cov-report=term-missing --cov-report=xml --cov-append
- name: Test ramp-engine
run: |
set -e
conda activate testenv
pytest -rvsl ramp-engine/ --cov=ramp_engine --cov-report=term-missing --cov-report=xml --cov-append
- name: Test ramp-database
run: |
set -e
conda activate testenv
pytest -rvsl ramp-database/ --cov=ramp_database --cov-report=term-missing --cov-report=xml --cov-append
- name: Test ramp-utils
run: |
set -e
conda activate testenv
pytest -rvsl ramp-utils/ --cov=ramp_utils --cov-report=term-missing --cov-report=xml --cov-append
- name: Test integration
run: |
set -e
conda activate testenv
bash ci_tools/actions/integration_test.sh
- uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
verbose: true
file: ./coverage.xml
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.10'
- name: Install dependencies
run: pip install flake8==6.0.0 black==22.3.0
- name: Run flake8
run: flake8 ramp-*
- name: Run black
run: black --check .