-
Notifications
You must be signed in to change notification settings - Fork 25
110 lines (98 loc) · 2.83 KB
/
examples.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
name: examples
on:
# Can be called by the CI
workflow_call:
inputs:
python_versions:
required: false
type: string
default: '["3.8"]'
ANSYS_VERSION:
required: false
type: string
default: "241"
standalone_suffix:
description: "Suffix of the branch on standalone"
required: false
type: string
default: ''
# Can be called manually
workflow_dispatch:
inputs:
python_versions:
description: "Python interpreters to test."
required: true
type: string
default: '["3.8"]'
ANSYS_VERSION:
description: "ANSYS version to run."
required: true
type: string
default: "241"
standalone_suffix:
description: "Suffix of the branch on standalone"
required: false
type: string
default: ''
env:
PACKAGE_NAME: ansys-dpf-core
MODULE: core
jobs:
setup:
name: "Setup"
runs-on: ubuntu-latest
outputs:
python_versions: ${{ steps.set_array.outputs.python_versions }}
steps:
- id: set_array
run: |
echo "python_versions=${{ toJSON(inputs.python_versions) }}" >> $GITHUB_OUTPUT
examples:
name: "Run Examples"
needs: setup
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ${{ fromJSON(needs.setup.outputs.python_versions) }}
os: ["windows-latest", "ubuntu-latest"]
steps:
- uses: actions/checkout@v3
- name: "Set licensing if necessary"
if: inputs.ANSYS_VERSION > 231
shell: bash
run: |
echo "ANSYS_DPF_ACCEPT_LA=Y" >> $GITHUB_ENV
echo "ANSYSLMD_LICENSE_FILE=1055@${{ secrets.LICENSE_SERVER }}" >> $GITHUB_ENV
- name: Setup Python
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- name: "Build Package"
uses: ansys/pydpf-actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
ANSYS_VERSION: ${{inputs.ANSYS_VERSION}}
PACKAGE_NAME: ${{ env.PACKAGE_NAME }}
MODULE: ${{ env.MODULE }}
dpf-standalone-TOKEN: ${{secrets.DPF_PIPELINE}}
install_extras: plotting
wheelhouse: false
wheel: false
standalone_suffix: ${{ inputs.standalone_suffix }}
- name: "Prepare Testing Environment"
uses: ansys/pydpf-actions/[email protected]
with:
DEBUG: true
- name: "List installed packages"
shell: bash
run: pip list
- name: "Run examples"
shell: bash
working-directory: .ci
run: |
echo on
python run_examples.py
- name: "Kill all servers"
uses: ansys/pydpf-actions/[email protected]
if: always()