2021-06-07 14:05:41 +02:00
|
|
|
name: TREXIO CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2022-03-07 14:34:23 +01:00
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
tags:
|
|
|
|
# After vMajor.Minor.Patch _anything_ is allowed (without "/") !
|
|
|
|
- v[0-9]+.[0-9]+.[0-9]+*
|
2021-06-07 14:05:41 +02:00
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
2022-03-07 14:34:23 +01:00
|
|
|
|
2022-01-07 11:03:00 +01:00
|
|
|
|
2021-06-07 14:05:41 +02:00
|
|
|
jobs:
|
2022-01-07 11:03:00 +01:00
|
|
|
|
|
|
|
get_commit_message:
|
|
|
|
name: Get commit message
|
2024-06-16 19:13:59 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2022-01-07 11:03:00 +01:00
|
|
|
outputs:
|
|
|
|
message: ${{ steps.commit_message.outputs.message }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout the repo
|
2023-04-03 21:40:59 +02:00
|
|
|
uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791
|
2022-01-07 11:03:00 +01:00
|
|
|
# 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)
|
2024-08-17 18:22:43 +02:00
|
|
|
echo "message=$COMMIT_MSG" >> $GITHUB_OUTPUT
|
|
|
|
echo github.ref ${{ github.ref }}
|
2022-01-07 11:03:00 +01:00
|
|
|
|
2021-06-07 14:05:41 +02:00
|
|
|
trexio_ubuntu:
|
2024-08-18 09:18:48 +02:00
|
|
|
name: x86 Ubuntu
|
2024-06-16 19:13:59 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2022-01-07 18:47:23 +01:00
|
|
|
needs: get_commit_message
|
2021-06-07 14:05:41 +02:00
|
|
|
|
|
|
|
steps:
|
2023-04-03 21:40:59 +02:00
|
|
|
- uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791
|
2022-01-07 11:03:00 +01:00
|
|
|
|
2023-10-27 13:07:48 +02:00
|
|
|
- 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
|
|
|
|
|
2024-11-10 21:34:27 +01:00
|
|
|
- name: setup fixed Python version for testing
|
|
|
|
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f
|
|
|
|
with:
|
|
|
|
python-version: '3.10'
|
|
|
|
|
2022-01-07 11:03:00 +01:00
|
|
|
- name: install dependencies
|
2021-06-07 14:05:41 +02:00
|
|
|
run: |
|
2024-06-16 19:13:59 +02:00
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install libhdf5-dev emacs
|
2022-01-07 11:03:00 +01:00
|
|
|
|
2021-06-07 14:05:41 +02:00
|
|
|
- name: configure with autotools
|
|
|
|
run: |
|
|
|
|
./autogen.sh
|
2021-11-01 10:20:03 +01:00
|
|
|
./configure --enable-silent-rules
|
2022-01-07 11:03:00 +01:00
|
|
|
|
2021-06-07 14:05:41 +02:00
|
|
|
- name: compile TREXIO
|
2022-07-08 11:26:17 +02:00
|
|
|
run: make -j2
|
2022-01-07 11:03:00 +01:00
|
|
|
|
2021-06-07 14:05:41 +02:00
|
|
|
- name: check TREXIO
|
2022-07-08 11:26:17 +02:00
|
|
|
run: make -j2 check
|
2021-09-14 10:17:20 +02:00
|
|
|
|
2023-01-04 13:25:06 +01:00
|
|
|
- name: Archive test log file
|
|
|
|
if: failure()
|
2024-08-18 10:04:37 +02:00
|
|
|
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
|
2023-01-04 13:25:06 +01:00
|
|
|
with:
|
2023-01-04 13:38:17 +01:00
|
|
|
name: test-report-ubuntu
|
2023-01-04 13:25:06 +01:00
|
|
|
path: test-suite.log
|
|
|
|
|
2024-06-16 19:13:59 +02:00
|
|
|
- name: create venv
|
2022-01-07 11:03:00 +01:00
|
|
|
run: |
|
2024-06-16 19:13:59 +02:00
|
|
|
python3 -m venv trexio-venv
|
|
|
|
source trexio-venv/bin/activate
|
2022-01-07 11:03:00 +01:00
|
|
|
|
2021-09-14 10:17:20 +02:00
|
|
|
- name: install Python API
|
2024-06-16 19:13:59 +02:00
|
|
|
run: |
|
|
|
|
source trexio-venv/bin/activate
|
|
|
|
make python-install
|
2021-09-14 10:17:20 +02:00
|
|
|
|
|
|
|
- name: check Python API
|
2024-06-16 19:13:59 +02:00
|
|
|
run: |
|
|
|
|
source trexio-venv/bin/activate
|
|
|
|
make python-test
|
2021-09-14 10:17:20 +02:00
|
|
|
|
2022-01-07 18:47:23 +01:00
|
|
|
- name: build and move Python API distribution
|
|
|
|
run: |
|
2024-06-16 19:13:59 +02:00
|
|
|
source trexio-venv/bin/activate
|
2022-01-07 18:47:23 +01:00
|
|
|
make python-sdist
|
|
|
|
cp python/dist/trexio-*.tar.gz .
|
2022-01-07 11:03:00 +01:00
|
|
|
|
|
|
|
- name: publish Python API distribution as an artifact
|
|
|
|
if: >-
|
|
|
|
contains(needs.get_commit_message.outputs.message, '[wheel build]') ||
|
|
|
|
github.event_name == 'release'
|
2024-08-18 10:04:37 +02:00
|
|
|
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
|
2022-01-07 11:03:00 +01:00
|
|
|
with:
|
|
|
|
name: pytrexio-source
|
|
|
|
path: ./trexio-*.tar.gz
|
|
|
|
|
2024-08-18 00:33:44 +02:00
|
|
|
- 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()
|
2024-08-18 10:04:37 +02:00
|
|
|
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
|
2024-08-18 00:33:44 +02:00
|
|
|
with:
|
2024-08-18 10:04:37 +02:00
|
|
|
name: test-report-ubuntu-memory
|
2024-08-18 00:33:44 +02:00
|
|
|
path: test-suite.log
|
|
|
|
|
|
|
|
- name: maintainer clean
|
|
|
|
run: make maintainer-clean
|
2021-06-07 14:05:41 +02:00
|
|
|
|
|
|
|
trexio_macos:
|
2024-08-18 09:18:48 +02:00
|
|
|
name: x86 and arm64 MacOS
|
|
|
|
strategy:
|
|
|
|
# macos-13 = x86_64 ; macos-14 = aarch64
|
|
|
|
matrix:
|
|
|
|
os: [macos-13, macos-14]
|
|
|
|
runs-on: ${{ matrix.os }}
|
2021-06-07 14:05:41 +02:00
|
|
|
|
|
|
|
steps:
|
2023-04-03 21:40:59 +02:00
|
|
|
- uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791
|
2022-01-07 11:03:00 +01:00
|
|
|
|
2024-11-10 21:34:27 +01:00
|
|
|
- name: setup fixed Python version for testing
|
|
|
|
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f
|
|
|
|
with:
|
|
|
|
python-version: '3.12'
|
|
|
|
|
2021-06-07 14:05:41 +02:00
|
|
|
- name: install dependencies
|
|
|
|
run: |
|
|
|
|
brew install emacs
|
2024-08-18 09:18:48 +02:00
|
|
|
brew install hdf5@1.14
|
2021-06-07 14:05:41 +02:00
|
|
|
brew install automake
|
2024-06-16 19:13:59 +02:00
|
|
|
brew install libtool
|
2024-11-10 21:57:54 +01:00
|
|
|
# SWIG 4.3.0 from homebrew with clang failed CI for macos@aarch64 - lol what?
|
|
|
|
pip install swig==4.2.1.post0
|
|
|
|
swig -version
|
|
|
|
|
2021-06-07 14:05:41 +02:00
|
|
|
- name: configure with autotools
|
|
|
|
run: |
|
2024-11-10 21:57:54 +01:00
|
|
|
brew --prefix hdf5
|
2021-06-07 14:05:41 +02:00
|
|
|
./autogen.sh
|
2024-08-18 09:18:48 +02:00
|
|
|
./configure CC=gcc-12 FC=gfortran-12 --enable-silent-rules
|
2022-01-07 11:03:00 +01:00
|
|
|
|
2021-06-07 14:05:41 +02:00
|
|
|
- name: compile TREXIO
|
2023-04-03 22:53:02 +02:00
|
|
|
run: make -j3
|
2022-01-07 11:03:00 +01:00
|
|
|
|
2021-06-07 14:05:41 +02:00
|
|
|
- name: check TREXIO
|
2023-04-03 22:53:02 +02:00
|
|
|
run: make -j3 check
|
2023-05-05 16:21:09 +02:00
|
|
|
|
2024-06-16 19:13:59 +02:00
|
|
|
- name: create venv
|
|
|
|
run: |
|
|
|
|
python3 -m venv trexio-venv
|
|
|
|
source trexio-venv/bin/activate
|
|
|
|
|
2023-05-05 16:21:09 +02:00
|
|
|
- name: compile Python API
|
|
|
|
run: |
|
|
|
|
export H5_CFLAGS="-I$(brew --prefix hdf5)/include"
|
|
|
|
export H5_LDFLAGS="-L$(brew --prefix hdf5)/lib"
|
2024-06-16 19:13:59 +02:00
|
|
|
source trexio-venv/bin/activate
|
2023-05-05 16:21:09 +02:00
|
|
|
make python-install
|
|
|
|
|
|
|
|
- name: test Python API
|
2024-06-16 19:13:59 +02:00
|
|
|
run: |
|
|
|
|
source trexio-venv/bin/activate
|
|
|
|
make python-test
|
2022-01-07 11:03:00 +01:00
|
|
|
|
2023-01-04 13:25:06 +01:00
|
|
|
- name: Archive test log file
|
|
|
|
if: failure()
|
2024-08-18 10:04:37 +02:00
|
|
|
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
|
2023-01-04 13:25:06 +01:00
|
|
|
with:
|
2024-08-18 09:18:48 +02:00
|
|
|
name: test-report-${{ matrix.os }}
|
2023-01-04 13:25:06 +01:00
|
|
|
path: test-suite.log
|
|
|
|
|
2021-06-07 14:05:41 +02:00
|
|
|
- name: clean
|
|
|
|
run: make clean
|