This repository has been archived by the owner on Oct 16, 2024. It is now read-only.
Update pytest output file names #91
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check COMPASS | |
on: | |
# push: # cannot use it due to EndBug/add-and-commit@v9 action which commit the new report | |
# branches: | |
# - main | |
# - saxoPlus | |
pull_request: | |
# Sequence of patterns matched against refs/heads | |
branches: | |
- beta | |
- main | |
- saxoPlus | |
jobs: | |
install_and_test: | |
runs-on: self-hosted | |
container: | |
image: aocompass/base-20.04:11.8.0 | |
options: --user root --gpus=all | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11"] | |
max-parallel: 1 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
ref: ${{ github.event.pull_request.head.ref }} | |
- name: Set up Anaconda with python ${{ matrix.python-version }} | |
run: | | |
conda create -y --name compass -c anaconda python=${{ matrix.python-version }} | |
- name: Install compass and dependencies | |
run: | | |
eval "$(/home/compass/miniconda3/bin/conda shell.bash hook)" | |
conda activate compass | |
conda install -c "compass/label/cuda11" compass | |
pip install coverage flake8 pytest pytest-cov pytest-cover pytest-coverage pytest-html pytest-metadata | |
- name: Lint with flake8 | |
run: | | |
eval "$(/home/compass/miniconda3/bin/conda shell.bash hook)" | |
conda activate compass | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Check Compass on scao_sh_16x16_8pix | |
run: | | |
export SHESHA_ROOT=$PWD | |
export PYTHONPATH=$SHESHA_ROOT:$PYTHONPATH | |
export PYTHONDONTWRITEBYTECODE=1 | |
eval "$(/home/compass/miniconda3/bin/conda shell.bash hook)" | |
conda activate compass | |
ipython -i shesha/scripts/closed_loop.py data/par/par4bench/scao_sh_16x16_8pix.py | |
- name: Check Compass | |
run: | | |
export SHESHA_ROOT=$PWD | |
export PYTHONPATH=$SHESHA_ROOT:$PYTHONPATH | |
export PYTHONDONTWRITEBYTECODE=1 | |
eval "$(/home/compass/miniconda3/bin/conda shell.bash hook)" | |
conda activate compass | |
./tests/checkCompass.sh | |
- name: Archive check results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: report | |
path: | | |
report_E2E.md | |
- name: Build coverage file and unit tests report | |
run: | | |
export SHESHA_ROOT=$PWD | |
export PYTHONPATH=$SHESHA_ROOT:$PYTHONPATH | |
export PYTHONDONTWRITEBYTECODE=1 | |
eval "$(/home/compass/miniconda3/bin/conda shell.bash hook)" | |
conda activate compass | |
pytest --junitxml=pytest-sup.xml --cov-report=term-missing:skip-covered --cov=shesha tests/pytest/supervisor | tee pytest-coverage.txt | |
pytest --junitxml=pytest-rtc.xml --cov-report=term-missing:skip-covered --cov=shesha tests/pytest/rtc | tee pytest-rtc-coverage.txt | |
pytest --junitxml=pytest-rtc_standalone.xml --cov-report=term-missing:skip-covered --cov=shesha tests/pytest/rtc_standalone | tee pytest-rtc_standalone-coverage.txt | |
- name: Fix dubious ownership | |
run: git config --global --add safe.directory /__w/shesha/shesha | |
- name: Pytest coverage comment | |
uses: MishaKav/pytest-coverage-comment@main | |
with: | |
multiple-files: | | |
Supervisor, pytest-coverage.txt, pytest-sup.xml | |
RTC, pytest-rtc-coverage.txt, pytest-rtc.xml | |
RTC Standalone, pytest-rtc_standalone-coverage.txt, pytest-rtc_standalone.xml | |
# pytest-xml-coverage-path: pytest-coverage.xml | |
# pytest-coverage-path: pytest-coverage.txt | |
# junitxml-path: pytest.xml | |
title: COMPASS Coverage Report | |
badge-title: Coverage | |
hide-badge: false | |
hide-report: false | |
create-new-comment: false | |
hide-comment: false | |
report-only-changed-files: false | |
remove-link-from-badge: false | |
# - name: Archive report | |
# if: vars.GITHUB_REF_NAME != 'main' | |
# uses: EndBug/add-and-commit@v9 | |
# with: | |
# default_author: github_actions | |
# message: 'Update report_E2E.md' | |
# add: 'report_E2E.md' |