1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-11-03 20:54:07 +01:00
trexio/.github/workflows/actions.yml

157 lines
4.1 KiB
YAML
Raw Normal View History

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 ]
2022-01-07 11:03:00 +01:00
jobs:
2022-01-07 11:03:00 +01:00
get_commit_message:
name: Get commit message
2022-12-01 18:11:02 +01:00
runs-on: ubuntu-20.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)
echo "::set-output name=message::$COMMIT_MSG"
trexio_ubuntu:
2022-12-01 18:11:02 +01:00
name: x86 Ubuntu 20.04
2023-04-03 22:53:02 +02:00
runs-on: ubuntu-20.04
needs: get_commit_message
steps:
2023-04-03 21:40:59 +02:00
- uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791
2022-01-07 11:03:00 +01:00
- name: install dependencies
run: |
sudo add-apt-repository ppa:kelleyk/emacs
2022-12-01 17:53:45 +01:00
sudo apt-get install libhdf5-dev emacs26
2022-01-07 11:03:00 +01:00
- name: configure with autotools
run: |
./autogen.sh
./configure --enable-silent-rules
2022-01-07 11:03:00 +01:00
- name: compile TREXIO
2022-07-08 11:26:17 +02:00
run: make -j2
2022-01-07 11:03:00 +01:00
- name: check TREXIO
2022-07-08 11:26:17 +02:00
run: make -j2 check
2023-01-04 13:25:06 +01:00
- name: Archive test log file
if: failure()
uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2
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
- name: create virtual environment
2022-01-07 11:03:00 +01:00
run: |
python3 -m venv --clear pytrexio-venv
source pytrexio-venv/bin/activate
2022-01-07 11:03:00 +01:00
- name: install Python API
run: make python-install
- name: check Python API
run: make python-test
- name: build and move Python API distribution
run: |
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'
2023-04-03 21:40:59 +02:00
uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2
2022-01-07 11:03:00 +01:00
with:
name: pytrexio-source
path: ./trexio-*.tar.gz
2022-07-08 11:26:17 +02:00
- name: maintainer clean
run: make maintainer-clean
- name: reconfigure with clang and AddressSanitizer
run: |
./autogen.sh
./configure CC=clang-11 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
2023-01-04 13:25:06 +01:00
- name: Archive test log file
if: failure()
uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2
with:
2023-01-04 13:38:17 +01:00
name: test-report-ubuntu-2
2023-01-04 13:25:06 +01:00
path: test-suite.log
2022-07-08 11:26:17 +02:00
- name: maintainer clean
run: make maintainer-clean
trexio_macos:
2023-05-05 16:21:09 +02:00
name: x86 MacOS 12
runs-on: macos-12
steps:
2023-04-03 21:40:59 +02:00
- uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791
2022-01-07 11:03:00 +01:00
- name: install dependencies
run: |
brew install emacs
2023-05-05 16:21:09 +02:00
brew install hdf5@1.12
brew install automake
2023-05-05 16:21:09 +02:00
brew --prefix hdf5
2022-01-07 11:03:00 +01:00
- name: configure with autotools
run: |
./autogen.sh
./configure FC=gfortran-12 --enable-silent-rules
2022-01-07 11:03:00 +01:00
- name: compile TREXIO
2023-04-03 22:53:02 +02:00
run: make -j3
2022-01-07 11:03:00 +01:00
- name: check TREXIO
2023-04-03 22:53:02 +02:00
run: make -j3 check
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"
make python-install
- name: test Python API
run: 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()
uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2
with:
2023-01-04 13:38:17 +01:00
name: test-report-macos
2023-01-04 13:25:06 +01:00
path: test-suite.log
- name: clean
run: make clean