forked from pyccel/pyccel
-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (106 loc) · 3.36 KB
/
linux.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Linux unit tests
on:
workflow_dispatch:
inputs:
python_version:
required: true
type: string
ref:
required: false
type: string
check_run_id:
required: false
type: string
pr_repo:
required: false
type: string
push:
branches: [devel, main]
env:
COMMIT: ${{ inputs.ref || github.event.ref }}
PEM: ${{ secrets.BOT_PEM }}
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_CHECK_RUN_ID: ${{ inputs.check_run_id }}
PR_REPO: ${{ inputs.pr_repo || github.repository }}
jobs:
matrix_prep:
runs-on: ubuntu-latest
if: github.event_name != 'push' || github.repository == 'pyccel/pyccel-cuda'
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: push-matrix
if: github.event_name == 'push'
run: |
echo "matrix=['3.8', '3.9', '3.10', '3.11', '3.12']" >> $GITHUB_ENV
shell: bash
- id: dispatch-matrix
if: github.event_name == 'workflow_dispatch'
run: |
echo "matrix=[${{ inputs.python_version }}]" >> $GITHUB_ENV
shell: bash
- id: set-matrix
run: |
echo "$matrix"
echo "matrix={\"python_version\": $matrix}" >> $GITHUB_OUTPUT
shell: bash
Linux:
runs-on: ubuntu-latest
name: Unit tests
needs: matrix_prep
strategy:
matrix: ${{fromJson(needs.matrix_prep.outputs.matrix)}}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.COMMIT }}
repository: ${{ env.PR_REPO }}
submodules: true
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: "Setup"
if: github.event_name != 'push'
id: token
run: |
pip install jwt requests
python ci_tools/setup_check_run.py linux
- name: Install dependencies
uses: ./.github/actions/linux_install
- name: Install Pyccel with tests
run: |
python -m pip install --upgrade pip
python -m pip install .[test] "numpy<2.0"
shell: bash
- name: Coverage install
uses: ./.github/actions/coverage_install
- name: Fortran/C tests with pytest
id: f_c_pytest
timeout-minutes: 60
uses: ./.github/actions/pytest_run
- name: Python tests with pytest
id: python_pytest
timeout-minutes: 20
uses: ./.github/actions/pytest_run_python
- name: Parallel tests with pytest
id: parallel
timeout-minutes: 20
uses: ./.github/actions/pytest_parallel
- name: Test with valgrind for memory leaks
id: valgrind
uses: ./.github/actions/valgrind_run
- name: Collect coverage information
continue-on-error: True
uses: ./.github/actions/coverage_collection
- name: Save code coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-artifact-${{ matrix.python_version }}
path: .coverage
retention-days: 3
include-hidden-files: true
- name: "Post completed"
if: always() && github.event_name != 'push'
run:
python ci_tools/complete_check_run.py ${{ steps.f_c_pytest.outcome }} ${{ steps.python_pytest.outcome }} ${{ steps.parallel.outcome }} ${{ steps.valgrind.outcome }}