Skip to content

Modularize

Modularize #182

name: buildtest
on:
push:
branches:
- "master"
pull_request:
branches:
- "master"
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
type: choice
options:
- info
- warning
- debug
tags:
description: 'Test scenario tags'
required: false
type: boolean
jobs:
buildtest:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13, macos-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Set up Python ${{ matrix.python-version }}
with:
python-version: ${{ matrix.python-version }}
- name: Pre-Install (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install slurm slurm-client openmpi-bin clang gfortran clinfo
sudo apt-get install environment-modules likwid
- name: Pre-Install (MacOS x86)
if: startsWith(matrix.os, 'macos-13')
run: |
brew install slurm open-mpi gcc clinfo modules;
export PATH="/usr/local/opt/gcc@14/bin":$PATH;
export CC=gcc-14; export CXX=g++-14;
export FC=gfortran
# do not install clinfo as it is broken for macos-14/15
- name: Pre-Install (MacOS Arm64)
if: startsWith(matrix.os, 'macos') && !contains(matrix.os, 'macos-13')
run: |
brew install slurm open-mpi gcc modules;
export PATH="/usr/local/opt/gcc@14/bin":$PATH;
export CC=gcc-14; export CXX=g++-14;
export FC=gfortran
- name: Pre-Install (generic)
run: |
python -m pip install codecov
python -m pip install requests
python -m pip install --upgrade pip
- name: Build single-file
run: |
python build_single.py
test -f machinestate.py && echo "machinestate.py generated."
- name: Install
run: |
python -m pip install -e .
- name: Test
run: |
coverage run -p tests/all_tests.py
coverage run -p `which machinestate` -e -s -i 4
coverage run -p `which machinestate` -e -s -i 4 -o output-ext.json
coverage run -p `which machinestate` -s -i 4 -o output.json
CC=testcompiler CXX=testccompiler FC=testfortran coverage run -p `which machinestate` -c
coverage run -p `which machinestate` -e -s -a -m hostname
coverage run -p `which machinestate` -p output.json
coverage run -p `which machinestate` -e -j output.json
coverage run -p `which machinestate` -p output-ext.json
coverage run -p `which machinestate` --html
coverage run -p `which machinestate` --html -o output.html
- uses: codecov/codecov-action@v4