@@ -22,41 +22,73 @@ jobs:
22
22
matrix :
23
23
os : [ubuntu-latest]
24
24
python-version : ['3.9', '3.10', '3.11', '3.12']
25
+ include :
26
+ - os : macos-latest
27
+ python-version : ' 3.12'
28
+
25
29
steps :
26
30
- name : Checkout FFCx
27
31
uses : actions/checkout@v4
32
+
28
33
- name : Set up Python
29
34
uses : actions/setup-python@v5
30
35
with :
31
36
python-version : ${{ matrix.python-version }}
37
+
38
+ - name : Export GitHub Actions cache environment variables (Windows)
39
+ if : runner.os == 'Windows'
40
+ uses : actions/github-script@v6
41
+ with :
42
+ script : |
43
+ core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
44
+ core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
45
+
32
46
- name : Install dependencies (non-Python, Linux)
33
47
if : runner.os == 'Linux'
34
48
run : |
35
49
sudo apt-get install -y graphviz libgraphviz-dev ninja-build pkg-config
36
50
- name : Install dependencies (non-Python, macOS)
37
51
if : runner.os == 'macOS'
38
- run : brew install graphviz ninja pkg-config
39
- - name : Install FEniCS dependencies (Python)
52
+ run : brew install ninja pkg-config
53
+
54
+ - name : Install FEniCS dependencies (Python, Unix)
55
+ if : runner.os == 'Linux' || runner.os == 'macOS'
40
56
run : |
41
57
pip install git+https://github.com/FEniCS/ufl.git
42
58
pip install git+https://github.com/FEniCS/basix.git
43
- - name : Install FFCx
59
+
60
+ - name : Install FEniCS dependencies (Python, Windows)
61
+ if : runner.os == 'Windows'
62
+ env :
63
+ VCPKG_BINARY_SOURCES : " clear;x-gha,readwrite"
64
+ run : |
65
+ pip install git+https://github.com/FEniCS/ufl.git
66
+ pip install -v git+https://github.com/FEniCS/basix.git --config-settings=cmake.args=-DINSTALL_RUNTIME_DEPENDENCIES=ON --config-settings=cmake.args=-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
67
+
68
+ - name : Install FFCx (Linux, with optional dependencies)
69
+ if : runner.os == 'Linux'
70
+ run : pip install .[ci,optional]
71
+ - name : Install FFCx (macOS, Windows)
72
+ if : runner.os != 'Linux'
44
73
run : pip install .[ci]
74
+
45
75
- name : Static check with mypy
46
76
run : mypy ffcx/
47
- if : matrix.python-version != '3.12'
48
77
- name : ruff checks
49
78
run : |
50
79
ruff check .
51
80
ruff format --check .
81
+
52
82
- name : Run units tests
53
83
run : python -m pytest -n auto --cov=ffcx/ --junitxml=junit/test-results-${{ matrix.os }}-${{ matrix.python-version }}.xml test/
84
+
54
85
- name : Upload to Coveralls
55
86
if : ${{ github.repository == 'FEniCS/ffcx' && github.head_ref == '' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8' }}
56
87
env :
57
88
COVERALLS_REPO_TOKEN : ${{ secrets.COVERALLS_REPO_TOKEN }}
58
89
run : coveralls
59
90
continue-on-error : true
91
+
60
92
- name : Upload pytest results
61
93
uses : actions/upload-artifact@v4
62
94
with :
@@ -65,10 +97,15 @@ jobs:
65
97
# Use always() to always run this step to publish test results
66
98
# when there are test failures
67
99
if : always()
100
+
101
+ - name : Setup cl.exe (Windows)
102
+ if : runner.os == 'Windows'
103
+ uses : ilammy/msvc-dev-cmd@v1
104
+
68
105
- name : Run FFCx demos
69
106
run : |
70
107
pytest demo/test_demos.py
71
- rm -Rf ufl/
108
+
72
109
- name : Build documentation
73
110
run : |
74
111
cd doc
80
117
path : doc/build/html/
81
118
retention-days : 2
82
119
if-no-files-found : error
120
+
83
121
- name : Checkout FEniCS/docs
84
122
if : ${{ github.repository == 'FEniCS/ffcx' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') ) && runner.os == 'Linux' && matrix.python-version == 3.8 }}
85
123
uses : actions/checkout@v4
0 commit comments