-
Notifications
You must be signed in to change notification settings - Fork 55
/
action.yml
84 lines (80 loc) · 3.43 KB
/
action.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
name: 'Pyccel pytest commands generating fortran or c'
inputs:
shell_cmd:
description: 'Specifies the shell command (different for anaconda)'
required: false
default: 'bash'
pytest_mark:
description: 'Mark expression to exclude additional tests'
required: false
default: ''
runs:
using: "composite"
steps:
- name: Set up runner
run: |
which python
if [ -n "${{ runner.debug }}" ]
then
# If running in debug mode
echo "DEBUG=1" >> $GITHUB_ENV
export FLAGS="-xsv --log-cli-level DEBUG"
else
export FLAGS=""
fi
echo "FLAGS=${FLAGS}" >> $GITHUB_ENV
shell: ${{ inputs.shell_cmd }}
working-directory: ./tests
- name: Test C translation
run: python -m pytest -n auto -rX ${FLAGS} -m "not (parallel or xdist_incompatible) and c ${{ inputs.pytest_mark }}" --ignore=ndarrays 2>&1 | tee s1_outfile.out
shell: ${{ inputs.shell_cmd }}
working-directory: ./tests
id: pytest_1
- name: Test folder update
run: |
if [ -n "${SITE_DIR}" ]; then
echo "Touching"
# Test ndarray folder update (requires parallel tests to avoid clean)
touch ${SITE_DIR}/pyccel/stdlib/cwrapper/cwrapper.h
python -m pytest -n auto -rX ${FLAGS} -m c -k test_array_int32_1d_scalar epyccel/test_arrays.py 2>&1 | tee s2_outfile.out
fi
shell: ${{ inputs.shell_cmd }}
working-directory: ./tests
id: pytest_2
- name: Test multi-file C translations
run: |
python -m pytest -rX ${FLAGS} -m "xdist_incompatible and not parallel and c ${{ inputs.pytest_mark }}" --ignore=ndarrays 2>&1 | tee s3_outfile.out
pyccel-clean
shell: ${{ inputs.shell_cmd }}
working-directory: ./tests
id: pytest_3
- name: Test Fortran translations
run: python -m pytest -n auto -rX ${FLAGS} -m "not (parallel or xdist_incompatible) and not (c or python) ${{ inputs.pytest_mark }}" --ignore=ndarrays 2>&1 | tee s4_outfile.out
shell: ${{ inputs.shell_cmd }}
working-directory: ./tests
id: pytest_4
- name: Test multi-file Fortran translations
run: |
python -m pytest -rX ${FLAGS} -m "xdist_incompatible and not parallel and not (c or python) ${{ inputs.pytest_mark }}" --ignore=ndarrays 2>&1 | tee s5_outfile.out
pyccel-clean
shell: ${{ inputs.shell_cmd }}
working-directory: ./tests
id: pytest_5
- name: Test ndarrays
run: |
python -m pytest ndarrays/ -rX ${FLAGS} 2>&1 | tee s6_outfile.out
pyccel-clean
shell: ${{ inputs.shell_cmd }}
working-directory: ./tests
id: pytest_6
- name: Final step
if: always()
id: status
run:
python ci_tools/json_pytest_output.py -t "Linux Test Summary" --tests "C tests:${{ steps.pytest_1.outcome }}:tests/s1_outfile.out" \
"Verification of stdlib update:${{ steps.pytest_2.outcome }}:tests/s2_outfile.out" \
"Non-parallelisable C tests:${{ steps.pytest_3.outcome }}:tests/s3_outfile.out" \
"Fortran tests:${{ steps.pytest_4.outcome }}:tests/s4_outfile.out" \
"Non-parallelisable Fortran tests:${{ steps.pytest_5.outcome }}:tests/s5_outfile.out" \
"Ndarray tests for C stdlib:${{ steps.pytest_6.outcome }}:tests/s6_outfile.out"
shell: ${{ inputs.shell_cmd }}