-
Notifications
You must be signed in to change notification settings - Fork 14
93 lines (85 loc) · 3.49 KB
/
tests_local.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# yamllint disable
name: tests_local
on:
schedule:
- cron: '0 1 * * *'
pull_request:
push:
branches:
- main
workflow_dispatch:
env:
# Set TEST_TIMING_OPTION if local test should be timed. Default is off.
TEST_TIMING_OPTION: ""
jobs:
run_tests:
runs-on: ubuntu-latest
container:
image: ghcr.io/4c-multiphysics/4c:latest
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- name: Install rsync
run: |
sudo apt-get update
sudo apt-get install -y rsync
- name: Create links to 4C
run: |
ln -s /home/user/4C/build/4C config/4C
ln -s /home/user/4C/build/post_ensight config/post_ensight
ln -s /home/user/4C/build/post_processor config/post_processor
- name: Create Python environment
id: environment
uses: ./.github/actions/create_python_environment
- name: Get Python package manager
run: echo "PYTHON_PACKAGE_MANAGER=${{steps.environment.outputs.ppm}}" >> $GITHUB_ENV
- name: Check compatibility of licenses of dependencies
id: license_check_report
uses: pilosus/action-pip-license-checker@v2
with:
requirements: requirements.txt,dev-requirements.txt
fail: StrongCopyleft,NetworkCopyleft
exclude: '(?i)^(pylint|yamllint)'
- name: Print report
run: echo "${{ steps.license_check_report.outputs.report }}"
- name: Codechecks
run: |
$PYTHON_PACKAGE_MANAGER activate queens
echo "::group::Run isort..."
isort --check-only queens tests
echo "::endgroup::"
echo "::group::Run black..."
black --check queens tests
echo "::endgroup::"
echo "::group::Run pylint..."
pylint --rcfile=.pylintrc_ci queens tests
# pylint queens tests --rcfile=.pylintrc --output-format=json:pylint_warnings.json --fail-under 0
echo "::endgroup::"
# echo "::group::Create code quality report..."
# python .gitlab/pipeline_utils/code_quality_creator.py pylint_warnings.json
# pydocstyle --match-dir='^(?!.*test).*$' queens
# echo "::endgroup::"
echo "::group::Create an rc file for the license header check..."
python .gitlab/pipeline_utils/create_licenserc.py --template_file ".gitlab/pipeline_utils/.licenserc_template.yaml" --text_file "license_header.tmpl" --output_file ".licenserc.yaml" --placeholder "license_header"
echo "::endgroup::"
- name: Check License headers
uses: apache/skywalking-eyes/[email protected]
- name: Run pytest
run: |
$PYTHON_PACKAGE_MANAGER activate queens
pytest -v -m "unit_tests or integration_tests or integration_tests_fourc" --cov --cov-report=term --cov-report=html:html_coverage_report --cov-report=xml:xml_coverage_report.xml $TEST_TIMING_OPTION --color=yes -o junit_logging=all --junitxml=test_junit.xml
- name: Upload coverage report
uses: actions/upload-pages-artifact@v3
with:
path: html_coverage_report
retention-days: 7
- name: Publish junit pytest report
uses: mikepenz/action-junit-report@v5
if: success() || failure() # always run even if the previous step fails
with:
report_paths: "test_junit.xml"
annotate_only: true
detailed_summary: true