Skip to content

Commit

Permalink
ajout CI github
Browse files Browse the repository at this point in the history
  • Loading branch information
steuxyo authored and dyoussef committed Jul 24, 2024
1 parent 250228f commit c9caca6
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 40 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/cars-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

name: CARS

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install --upgrade cython numpy
pip install --upgrade numba
pip install .[dev,docs,notebook,pandora_mccnn]
pip list
- name: Unit Tests
run: |
pytest -m "unit_tests" -o log_cli=true -o log_cli_level=INFO
- name: Lint Tests
run: |
echo "Lint test"
isort --check cars tests
black --check cars tests
flake8 cars tests
pylint cars tests --rcfile=.pylintrc --output-format=parseable | tee pylint-report.txt # pipefail to propagate pylint exit code in bash
- name: Notebooks Tests
run: |
pytest -m "notebook_tests" -o log_cli=true -o log_cli_level=INFO
- name: End2end Tests
run: |
pytest -m "end2end_tests" -o log_cli=true -o log_cli_level=INFO
- name: Create source distribution
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: |
python -m build --sdist
- name: Publish package on pypi
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
[![Contributions welcome](https://img.shields.io/badge/contributions-welcome-orange.svg)](CONTRIBUTING.md)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0/)
[![Documentation](https://readthedocs.org/projects/cars/badge/?version=latest)](https://cars.readthedocs.io/?badge=latest)
[![Github Action](https://github.com/CNES/cars/actions/workflows/cars-ci.yml/badge.svg?branch=master)](https://github.com/CNES/cars/actions)

<p>
<a href="#overview">Overview</a> •
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ dev =
memray
dash
plotly
build # for cars build

# [docs] mode dependencies
docs =
Expand Down
16 changes: 14 additions & 2 deletions tests/orchestrator/cluster/test_cluster_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,24 @@
conf_auto,
conf_mp,
conf_local_dask,
conf_pbs_dask,
conf_slurm_dask,
],
)
def test_check_full_conf(conf):
"""
Test configuration check for orchestrator
"""
_ = Orchestrator(conf)


@pytest.mark.slurm_cluster_tests
@pytest.mark.parametrize(
"conf",
[
conf_slurm_dask,
],
)
def test_check_full_conf_slurm(conf):
"""
Test configuration check for orchestrator
"""
_ = Orchestrator(conf)
76 changes: 38 additions & 38 deletions tests/test_end2end.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ def test_end2end_gizeh_rectangle_epi_image_performance_map():
absolute_data_path(
os.path.join(ref_output_dir, "clr_end2end_gizeh_crop.tif")
),
rtol=1.0e-7,
atol=1.0e-7,
rtol=0.0002,
atol=1.0e-6,
)
assert_same_images(
os.path.join(out_dir, "msk.tif"),
Expand Down Expand Up @@ -254,8 +254,8 @@ def test_end2end_gizeh_rectangle_epi_image_performance_map():
ref_output_dir, "clr_end2end_gizeh_crop_no_merging.tif"
)
),
rtol=1.0e-6,
atol=1.0e-4,
rtol=0.0002,
atol=1.0e-6,
)
assert_same_images(
os.path.join(out_dir, "msk.tif"),
Expand Down Expand Up @@ -849,8 +849,8 @@ def test_end2end_ventoux_unique():
"confidence_from_intensity_std_end2end_ventoux.tif",
)
),
atol=1.0e-7,
rtol=1.0e-7,
atol=1.0e-5,
rtol=1.0e-6,
)
assert_same_images(
os.path.join(out_dir, "confidence_from_risk_min_risk.tif"),
Expand Down Expand Up @@ -882,8 +882,8 @@ def test_end2end_ventoux_unique():
"confidence_from_ambiguity_before_end2end_ventoux.tif",
)
),
atol=1.0e-7,
rtol=1.0e-7,
atol=1.0e-6,
rtol=1.0e-6,
)
assert_same_images(
os.path.join(
Expand All @@ -896,8 +896,8 @@ def test_end2end_ventoux_unique():
"confidence_from_intensity_std_before_end2end_ventoux.tif",
)
),
atol=1.0e-7,
rtol=1.0e-7,
atol=1.0e-6,
rtol=1.0e-6,
)
assert_same_images(
os.path.join(out_dir, "confidence_from_risk_min_risk_before.tif"),
Expand Down Expand Up @@ -926,8 +926,8 @@ def test_end2end_ventoux_unique():
absolute_data_path(
os.path.join(ref_output_dir, "clr_end2end_ventoux.tif")
),
rtol=1.0e-7,
atol=1.0e-7,
rtol=0.0002,
atol=1.0e-6,
)
assert os.path.exists(os.path.join(out_dir, "msk.tif")) is False

Expand Down Expand Up @@ -1027,8 +1027,8 @@ def test_end2end_ventoux_unique():
absolute_data_path(
os.path.join(ref_output_dir, "clr_end2end_ventoux.tif")
),
rtol=1.0e-7,
atol=1.0e-7,
rtol=0.0002,
atol=1.0e-6,
)
assert os.path.exists(os.path.join(out_dir, "msk.tif")) is False

Expand Down Expand Up @@ -1124,8 +1124,8 @@ def test_end2end_ventoux_unique():
absolute_data_path(
os.path.join(ref_output_dir, "clr_end2end_ventoux.tif")
),
rtol=1.0e-7,
atol=1.0e-7,
rtol=0.0002,
atol=1.0e-6,
)
assert os.path.exists(os.path.join(out_dir, "msk.tif")) is False

Expand Down Expand Up @@ -2048,8 +2048,8 @@ def test_end2end_use_epipolar_a_priori():
absolute_data_path(
os.path.join(ref_output_dir, "clr_end2end_ventoux_no_srtm.tif")
),
rtol=1.0e-7,
atol=1.0e-7,
rtol=0.0002,
atol=1.0e-6,
)
assert_same_images(
os.path.join(out_dir, "confidence_from_ambiguity.tif"),
Expand Down Expand Up @@ -2385,8 +2385,8 @@ def test_end2end_ventoux_with_color():
ref_output_dir, "clr_end2end_ventoux_with_color.tif"
)
),
rtol=1.0e-7,
atol=1.0e-7,
rtol=0.0002,
atol=1.0e-6,
)


Expand Down Expand Up @@ -2753,8 +2753,8 @@ def test_compute_dsm_with_roi_ventoux():
absolute_data_path(
os.path.join(ref_output_dir, "clr_end2end_ventoux_with_roi.tif")
),
rtol=1.0e-7,
atol=1.0e-7,
rtol=0.0002,
atol=1.0e-6,
)
assert os.path.exists(os.path.join(out_dir, "msk.tif")) is False

Expand Down Expand Up @@ -2897,8 +2897,8 @@ def test_compute_dsm_with_snap_to_img1():
ref_output_dir, "clr_end2end_ventoux_with_snap_to_img1.tif"
)
),
rtol=1.0e-7,
atol=1.0e-7,
rtol=0.0002,
atol=1.0e-6,
)
assert os.path.exists(os.path.join(out_dir, "msk.tif")) is False

Expand Down Expand Up @@ -3133,8 +3133,8 @@ def test_end2end_quality_stats():
ref_output_dir, "clr_end2end_ventoux_quality_stats.tif"
)
),
rtol=1.0e-7,
atol=1.0e-7,
rtol=0.0002,
atol=1.0e-6,
)
assert_same_images(
os.path.join(out_dir, "dsm_mean.tif"),
Expand Down Expand Up @@ -3312,8 +3312,8 @@ def test_end2end_ventoux_egm96_geoid():
absolute_data_path(
os.path.join(ref_output_dir, "clr_end2end_ventoux_egm96.tif")
),
rtol=1.0e-7,
atol=1.0e-7,
rtol=0.0002,
atol=1.0e-6,
)
assert os.path.exists(os.path.join(out_dir, "msk.tif")) is False

Expand Down Expand Up @@ -3400,8 +3400,8 @@ def test_end2end_ventoux_egm96_geoid():
absolute_data_path(
os.path.join(ref_output_dir, "clr_end2end_ventoux_egm96.tif")
),
rtol=1.0e-7,
atol=1.0e-7,
rtol=0.0002,
atol=1.0e-6,
)
assert os.path.exists(os.path.join(out_dir, "msk.tif")) is False

Expand Down Expand Up @@ -3519,8 +3519,8 @@ def test_end2end_paca_with_mask():
absolute_data_path(
os.path.join(ref_output_dir, "clr_end2end_paca.tif")
),
rtol=1.0e-7,
atol=1.0e-7,
rtol=0.0002,
atol=1.0e-6,
)
assert_same_images(
os.path.join(out_dir, "msk.tif"),
Expand Down Expand Up @@ -3614,8 +3614,8 @@ def test_end2end_paca_with_mask():
absolute_data_path(
os.path.join(ref_output_dir, "clr_end2end_paca.tif")
),
rtol=1.0e-7,
atol=1.0e-7,
rtol=0.0002,
atol=1.0e-6,
)
assert_same_images(
os.path.join(out_dir, "msk.tif"),
Expand Down Expand Up @@ -3738,8 +3738,8 @@ def test_end2end_disparity_filling():
absolute_data_path(
os.path.join(ref_output_dir, "clr_end2end_gizeh_fill.tif")
),
rtol=1.0e-7,
atol=1.0e-7,
rtol=0.0002,
atol=1.0e-6,
)
assert_same_images(
os.path.join(out_dir, "msk.tif"),
Expand Down Expand Up @@ -3877,8 +3877,8 @@ def test_end2end_disparity_filling_with_zeros():
ref_output_dir, "clr_end2end_gizeh_fill_with_zero.tif"
)
),
rtol=1.0e-7,
atol=1.0e-7,
rtol=0.0002,
atol=1.0e-6,
)
assert_same_images(
os.path.join(out_dir, "msk.tif"),
Expand Down

0 comments on commit c9caca6

Please sign in to comment.