@@ -20,15 +20,6 @@ concurrency:
20
20
21
21
jobs :
22
22
23
- style :
24
- name : Code style
25
- runs-on : ubuntu-latest
26
- steps :
27
- - name : PyAnsys code style checks
28
- uses : pyansys/actions/code-style@v3
29
- with :
30
- python-version : ${{ env.MAIN_PYTHON_VERSION }}
31
-
32
23
docs-style :
33
24
name : Documentation Style Check
34
25
runs-on : ubuntu-latest
38
29
with :
39
30
token : ${{ secrets.GITHUB_TOKEN }}
40
31
32
+ docs :
33
+ name : Documentation
34
+ runs-on : ubuntu-latest
35
+ needs : [docs-style]
36
+ steps :
37
+ - uses : actions/checkout@v3
38
+
39
+ - name : Set up Python ${{ env.MAIN_PYTHON_VERSION }}
40
+ uses : actions/setup-python@v4
41
+ with :
42
+ python-version : ${{ env.MAIN_PYTHON_VERSION }}
43
+ cache : ' pip'
44
+ cache-dependency-path : ' pyproject.toml'
45
+
46
+ - name : Install packages for documentation build
47
+ run : |
48
+ sudo apt-get install xvfb pandoc
49
+ pip install --upgrade build
50
+ pip install .[doc]
51
+
52
+ - name : Build the documentation
53
+ run : |
54
+ xvfb-run make -C doc html
55
+
56
+ - name : Upload HTML documentation
57
+ uses : actions/upload-artifact@v3
58
+ with :
59
+ name : documentation-html
60
+ path : doc/_build/html
61
+ retention-days : 7
62
+
63
+ style :
64
+ name : Code style
65
+ runs-on : ubuntu-latest
66
+ steps :
67
+ - name : PyAnsys code style checks
68
+ uses : pyansys/actions/code-style@v3
69
+ with :
70
+ python-version : ${{ env.MAIN_PYTHON_VERSION }}
71
+
41
72
smoke-tests :
42
73
name : Build and Smoke tests
43
74
runs-on : ${{ matrix.os }}
@@ -57,40 +88,64 @@ jobs:
57
88
operating-system : ${{ matrix.os }}
58
89
python-version : ${{ matrix.python-version }}
59
90
60
- docs :
61
- name : Documentation
62
- runs-on : ubuntu-latest
63
- needs : [docs-style]
91
+ tests :
92
+ name : Testing
93
+ runs-on : ${{ matrix.os }}
94
+ needs : [smoke-tests]
95
+ strategy :
96
+ fail-fast : false
97
+ matrix :
98
+ os : [windows-latest, ubuntu-latest]
99
+
64
100
steps :
65
- - uses : actions/checkout@v3
101
+ - name : Checkout repository
102
+ uses : actions/checkout@v3
66
103
67
- - name : Set up Python ${{ env.MAIN_PYTHON_VERSION }}
104
+ - name : Set up Python
68
105
uses : actions/setup-python@v4
69
106
with :
70
107
python-version : ${{ env.MAIN_PYTHON_VERSION }}
71
108
cache : ' pip'
72
109
cache-dependency-path : ' pyproject.toml'
73
110
74
- - name : Install packages for documentation build
111
+ - name : Install ansys-dyna-core (with test requirements)
75
112
run : |
76
- sudo apt-get install xvfb pandoc
77
- pip install --upgrade build
78
- pip install .[doc]
113
+ pip install -e .[tests]
79
114
80
- - name : Build the documentation
115
+ - name : Run tests (Windows)
116
+ if : runner.os == 'Windows'
81
117
run : |
82
- xvfb-run make -C doc html
118
+ Start-Job -ScriptBlock {cd ${{ github.workspace }}\src\ansys\dyna\core\pre\Server\;python kwserver.py >> server_output.txt}
119
+ Start-Sleep -Seconds 10
120
+ pytest
83
121
84
- - name : Upload HTML documentation
122
+ - name : Run tests (Linux)
123
+ if : runner.os == 'Linux'
124
+ run : |
125
+ cd src/ansys/dyna/core/pre/Server
126
+ python kwserver.py > server_output.txt &
127
+ sleep 10
128
+ cd -
129
+ pytest
130
+
131
+ - name : Upload the server logs
132
+ if : always()
85
133
uses : actions/upload-artifact@v3
86
134
with :
87
- name : documentation-html
88
- path : doc/_build/html
135
+ name : server-logs-${{ runner.os }}
136
+ path : src/ansys/dyna/core/pre/Server/server_output.txt
137
+
138
+ - name : Upload coverage results
139
+ if : runner.os == 'Linux'
140
+ uses : actions/upload-artifact@v3
141
+ with :
142
+ name : coverage-html
143
+ path : .cov/html
89
144
retention-days : 7
90
145
91
146
package :
92
147
name : Package library
93
- needs : [docs]
148
+ needs : [docs, tests ]
94
149
runs-on : ubuntu-latest
95
150
steps :
96
151
- name : Build library source and wheel artifacts
@@ -114,7 +169,7 @@ jobs:
114
169
name : Upload dev documentation
115
170
if : github.ref == 'refs/heads/main'
116
171
runs-on : ubuntu-latest
117
- needs : [docs ]
172
+ needs : [package ]
118
173
steps :
119
174
- name : Deploy the latest documentation
120
175
uses : pyansys/actions/doc-deploy-dev@v3
0 commit comments