Commit b5232c0 1 parent 14757d1 commit b5232c0 Copy full SHA for b5232c0
File tree 3 files changed +53
-1
lines changed
3 files changed +53
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : example test
2
+ on :
3
+ workflow_call :
4
+ inputs :
5
+ os :
6
+ required : true
7
+ type : string
8
+ python-version :
9
+ required : true
10
+ type : string
11
+ use-cfg :
12
+ required : false
13
+ type : string
14
+ default : ' '
15
+
16
+ jobs :
17
+ test_examples :
18
+ runs-on : ${{ inputs.os }}
19
+ steps :
20
+ - uses : actions/checkout@v4
21
+ - name : Set up Python ${{ inputs.python-version }}
22
+ uses : actions/setup-python@v4
23
+ with :
24
+ python-version : ${{ inputs.python-version }}
25
+
26
+ - if : ${{ inputs.use-cfg != '' }}
27
+ uses : ' ./.github/workflows/setup-custom-cfg'
28
+ with :
29
+ siibra-cfg-ref : ${{ inputs.use-cfg }}
30
+
31
+ - name : Install dependencies
32
+ shell : bash
33
+ run : |
34
+ python -m pip install --upgrade pip
35
+ python -m pip install -U .
36
+ pip install -r requirements-test.txt
37
+ - name : Install test dependencies
38
+ run : pip install pytest pytest-cov coverage
39
+ - name : Run test with pytest
40
+ shell : bash
41
+ run : pytest -rx examples/test_examples.py
Original file line number Diff line number Diff line change 98
98
os : ubuntu-latest
99
99
python-version : " 3.8"
100
100
use-cfg : ${{ needs.use-custom-cfg.outputs.USE_REF }}
101
+
102
+ test-examples :
103
+ needs : ' use-custom-cfg'
104
+ uses : ./.github/workflows/_run_examples.yaml
105
+ with :
106
+ os : ubuntu-latest
107
+ python-version : " 3.8"
108
+ use-cfg : ${{ needs.use-custom-cfg.outputs.USE_REF }}
Original file line number Diff line number Diff line change 8
8
9
9
10
10
@pytest .mark .parametrize ('example' , examples )
11
- def test_script_execution (example ):
11
+ def test_script_execution (example : pathlib .Path ):
12
+ if example .name == "test_examples.py" :
13
+ print ("Skipping:" , example )
14
+ return
12
15
print ("Running:" , example )
13
16
runpy .run_path (example )
You can’t perform that action at this time.
0 commit comments