-
Notifications
You must be signed in to change notification settings - Fork 14
200 lines (164 loc) · 5.86 KB
/
actions.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
name: TREXIO CI
on:
push:
branches:
- master
tags:
# After vMajor.Minor.Patch _anything_ is allowed (without "/") !
- v[0-9]+.[0-9]+.[0-9]+*
pull_request:
branches: [ master ]
jobs:
get_commit_message:
name: Get commit message
runs-on: ubuntu-22.04
outputs:
message: ${{ steps.commit_message.outputs.message }}
steps:
- name: Checkout the repo
uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791
# Gets the correct commit message for pull request
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Get commit message
id: commit_message
run: |
set -xe
COMMIT_MSG=$(git log --no-merges -1 --oneline)
echo "message=$COMMIT_MSG" >> $GITHUB_OUTPUT
echo github.ref ${{ github.ref }}
trexio_ubuntu:
name: x86 Ubuntu
runs-on: ubuntu-22.04
needs: get_commit_message
steps:
- uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791
- name: check versions
run: |
grep AC_INIT configure.ac | tr -d '[]' | awk -F, '{ print $2 }' > configure_v
grep -w VERSION CMakeLists.txt | grep -v 'cmake_minimum_required' | awk '{ print $2 }' > cmake_v
grep version python/pytrexio/_version.py | tr -d '"' | awk '{ print $3 }' > python_v
grep version rust/trexio/Cargo.toml | grep -v features | tr -d '"' | awk '{ print $3 }' > rust_v
grep version ocaml/trexio/dune-project | tr -d '()' | awk '{ print $2 }' > ocaml_v
diff configure_v cmake_v
diff configure_v python_v
diff configure_v rust_v
diff configure_v ocaml_v
- name: setup fixed Python version for testing
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f
with:
python-version: '3.10'
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install libhdf5-dev emacs
- name: configure with autotools
run: |
./autogen.sh
./configure --enable-silent-rules
- name: compile TREXIO
run: make -j2
- name: check TREXIO
run: make -j2 check
- name: Archive test log file
if: failure()
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: test-report-ubuntu
path: test-suite.log
- name: create venv
run: |
python3 -m venv trexio-venv
source trexio-venv/bin/activate
- name: install Python API
run: |
source trexio-venv/bin/activate
make python-install
- name: check Python API
run: |
source trexio-venv/bin/activate
make python-test
- name: build and move Python API distribution
run: |
source trexio-venv/bin/activate
make python-sdist
cp python/dist/trexio-*.tar.gz .
- name: publish Python API distribution as an artifact
if: >-
contains(needs.get_commit_message.outputs.message, '[wheel build]') ||
github.event_name == 'release'
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: pytrexio-source
path: ./trexio-*.tar.gz
- name: maintainer clean
run: make maintainer-clean
- name: reconfigure with clang and AddressSanitizer
run: |
./autogen.sh
./configure CC=clang-15 CFLAGS="-O2 -fsanitize=address -fno-omit-frame-pointer" LDFLAGS="-fsanitize=address" --enable-silent-rules
- name: recompile TREXIO
run: make -j2
- name: recheck TREXIO for memory leaks
run: make -j2 check
- name: Archive test log file
if: failure()
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: test-report-ubuntu-memory
path: test-suite.log
- name: maintainer clean
run: make maintainer-clean
trexio_macos:
name: x86 and arm64 MacOS
strategy:
# macos-13 = x86_64 ; macos-14 = aarch64
matrix:
os: [macos-13, macos-14]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791
- name: setup fixed Python version for testing
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f
with:
python-version: '3.12'
- name: install dependencies
run: |
brew install emacs
brew install [email protected]
brew install automake
brew install libtool
# SWIG 4.3.0 from homebrew with clang failed CI for macos@aarch64 - lol what?
pip install swig==4.2.1.post0
swig -version
- name: configure with autotools
run: |
brew --prefix hdf5
./autogen.sh
./configure CC=gcc-12 FC=gfortran-12 --enable-silent-rules
- name: compile TREXIO
run: make -j3
- name: check TREXIO
run: make -j3 check
- name: create venv
run: |
python3 -m venv trexio-venv
source trexio-venv/bin/activate
- name: compile Python API
run: |
export H5_CFLAGS="-I$(brew --prefix hdf5)/include"
export H5_LDFLAGS="-L$(brew --prefix hdf5)/lib"
source trexio-venv/bin/activate
make python-install
- name: test Python API
run: |
source trexio-venv/bin/activate
make python-test
- name: Archive test log file
if: failure()
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: test-report-${{ matrix.os }}
path: test-suite.log
- name: clean
run: make clean