Skip to content

[ci] build matrix on ubuntu, openfoam, database, and smartsim versions #38

[ci] build matrix on ubuntu, openfoam, database, and smartsim versions

[ci] build matrix on ubuntu, openfoam, database, and smartsim versions #38

Workflow file for this run

name: tests_ubuntu
defaults:
run:
shell: bash -o pipefail -i {0}
on:
push:
branches:
- main
- ci
- 'bugfix*'
- 'releases/**'
pull_request:
types: [opened, reopened, synchronize]
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Tmate debugging session'
required: false
default: false
jobs:
build:
strategy:
fail-fast: false
matrix:
openfoam_version: ['2312', '2212']
smartsim_version: ['0.7.0', '0.6.2']
database_backend: ['redis']
ubuntu_version: ['22.04', '20.04'] ## SmartSim not available yet for Python 3.12 on Ubuntu 24
exclude:
- ubuntu_version: '20.04' ## SmartSim 0.7.0 not released on ubuntu 20.04
smartsim_version: '0.7.0'
runs-on: ubuntu-22.04
container:
image: ghcr.io/ofdatacommittee/openfoam-smartsim:of-${{ matrix.openfoam_version }}-smart-${{ matrix.smartsim_version }}-${{ matrix.database_backend }}-ubuntu-${{ matrix.ubuntu_version }}
env:
CATCH_TIMEOUT: 20
FOAM_FOAMUT: "/tmp/foamUT"
SSDB: "smartdb:6379"
services:
smartdb:
image: ${{ matrix.database_backend == 'redis' && 'redislabs/redisai' || 'eqalpha/keydb' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
with:
detached: true
- name: Compile
run: |
source /usr/lib/openfoam/openfoam${{ matrix.openfoam_version }}/etc/bashrc
mkdir -p $FOAM_USER_LIBBIN
./Allwmake
- name: Compile Tests and Run
run: |
source /usr/lib/openfoam/openfoam${{ matrix.openfoam_version }}/etc/bashrc
./Allwmake
export SSDB="smartdb:6379"
git clone https://github.com/FoamScience/foamUT $FOAM_FOAMUT
sed -i 's/mpirun/mpirun --oversubscribe/g' $FOAM_FOAMUT/Alltest
ln -s "$PWD"/tests "$FOAM_FOAMUT"/tests/smartSimFOTests
cd $FOAM_FOAMUT || exit 1
rm -rf tests/exampleTests
./Alltest "$@"