This repository has been archived by the owner on Oct 16, 2024. It is now read-only.
Update pytest output file names #103
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 -y | |
pip install coverage coverage-badge ruff pytest pytest-cov pytest-cover pytest-coverage pytest-html pytest-metadata | |
- name: Lint with Ruff | |
run: | | |
eval "$(/home/compass/miniconda3/bin/conda shell.bash hook)" | |
conda activate compass | |
ruff . | |
continue-on-error: true | |
- name: Check Compass on scao_sh_16x16_8pix | |
run: | | |
eval "$(/home/compass/miniconda3/bin/conda shell.bash hook)" | |
conda activate compass | |
export SHESHA_ROOT=$PWD | |
export PYTHONPATH=$SHESHA_ROOT:$PYTHONPATH | |
export PYTHONDONTWRITEBYTECODE=1 | |
python shesha/scripts/closed_loop.py data/par/par4bench/scao_sh_16x16_8pix.py | |
- name: Check Compass | |
run: | | |
eval "$(/home/compass/miniconda3/bin/conda shell.bash hook)" | |
conda activate compass | |
export SHESHA_ROOT=$PWD | |
export PYTHONPATH=$SHESHA_ROOT:$PYTHONPATH | |
export PYTHONDONTWRITEBYTECODE=1 | |
./tests/checkCompass.sh | |
- name: Archive check results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: report_${{ matrix.python-version }} | |
path: | | |
report_E2E.md | |
- name: Build coverage file and unit tests report | |
run: | | |
eval "$(/home/compass/miniconda3/bin/conda shell.bash hook)" | |
conda activate compass | |
export SHESHA_ROOT=$PWD | |
export PYTHONPATH=$SHESHA_ROOT:$PYTHONPATH | |
export PYTHONDONTWRITEBYTECODE=1 | |
pytest --junitxml=pytest-sup.xml --cov-report=term-missing:skip-covered --cov=shesha tests/pytest/supervisor | tee pytest-sub-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: Archive check results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: unit_tests_report_${{ matrix.python-version }} | |
path: | | |
pytest-sub-coverage.txt | |
pytest-sup.xml | |
pytest-rtc-coverage.txt | |
pytest-rtc.xml | |
pytest-rtc_standalone-coverage.txt | |
pytest-rtc_standalone.xml | |
- name: Pytest coverage comment | |
uses: MishaKav/pytest-coverage-comment@main | |
with: | |
multiple-files: | | |
Supervisor, pytest-sub-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-path: '' | |
junitxml-path: '' | |
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' |