Refact/sparse comm #2610
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build OpenFOAM (ESI|FOUNDATION) | ||
run-name: 'Build and integration' | ||
defaults: | ||
run: | ||
shell: bash -o pipefail -i {0} | ||
on: | ||
push: | ||
branches: | ||
- dev | ||
- main | ||
pull_request: | ||
types: synchronize | ||
schedule: | ||
- cron: "* 0 * * 0" | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
env: | ||
BUILD_TYPE: Release | ||
OMPI_ALLOW_RUN_AS_ROOT: 1 | ||
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1 | ||
jobs: | ||
setup_build_matrix: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- name: Checkout to repository | ||
uses: actions/checkout@v3 | ||
- name: Set matrix data | ||
id: set-matrix | ||
run: | | ||
pwd | ||
echo "matrix=$(jq -c . < .github/workflows/test_matrix.json)" >> $GITHUB_OUTPUT | ||
build: | ||
runs-on: ubuntu-latest | ||
container: greole/ofbase | ||
needs: setup_build_matrix | ||
name: build-${{matrix.OF.version}} | ||
strategy: | ||
fail-fast: false | ||
matrix: ${{ fromJson(needs.setup_build_matrix.outputs.matrix) }} | ||
# { | ||
# version: "5.0", | ||
# fork: "extend", | ||
# path: "foam-extend-5.0", | ||
# repo: "git://git.code.sf.net/p/foam-extend/foam-extend-5.0" | ||
# } | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Get Ginkgo checkout version | ||
shell: bash | ||
run: | | ||
grep -A1 "set(GINKGO_CHECKOUT_VERSION" CMakeLists.txt|tail -n1|grep -o "[0-9a-z\-]*" > GINKGO_CHECKOUT_VERSION | ||
export GINKGO_CHECKOUT_VERSION=$(cat GINKGO_CHECKOUT_VERSION) | ||
echo "GINKGO_CHECKOUT_VERSION=$GINKGO_CHECKOUT_VERSION" >> $GITHUB_ENV | ||
- name: Cache build folder | ||
uses: actions/cache@v3 | ||
with: | ||
key: build-${{ matrix.OF.path }}-${{env.GINKGO_CHECKOUT_VERSION}} | ||
path: | | ||
${{github.workspace}}/build | ||
- name: Cache FOAM_USER_LIBBIN | ||
uses: actions/cache@v3 | ||
with: | ||
key: FOAM_USER_LIBBIN-${{ matrix.OF.version }}-${{ github.sha }} | ||
path: | | ||
${{matrix.OF.foam_user_libbin}} | ||
- name: Configure CMake | ||
# Use a bash shell so we can use the same syntax for environment variable | ||
# access regardless of the host operating system | ||
working-directory: ${{github.workspace}} | ||
run: | | ||
source /root/OpenFOAM/${{matrix.OF.path}}/etc/bashrc | ||
mkdir -p ${{matrix.OF.foam_user_libbin}} | ||
mkdir -p build | ||
cd build | ||
[ -d "/github/home/$GINKGO_CHECKOUT_VERSION" ] && cp -rp /github/home/$GINKGO_CHECKOUT_VERSION third_party | ||
cmake -G Ninja -DOGL_ALLOW_REFERENCE_ONLY=On -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. | ||
- name: Build OGL | ||
working-directory: ${{github.workspace}}/build | ||
run: | | ||
cmake --build . --config $BUILD_TYPE | ||
- name: Install OGL | ||
working-directory: ${{github.workspace}} | ||
run: | | ||
cmake --install ./build | ||
- name: Check folders | ||
working-directory: ${{github.workspace}} | ||
run: | | ||
ls ./build | ||
ls ${{matrix.OF.foam_user_libbin}} | ||
- name: Archive production artifacts | ||
uses: actions/upload-artifact@v3 | ||
if: failure() | ||
with: | ||
name: ogl_build_${{ matrix.OF.path }} | ||
path: ${{github.workspace}}/build | ||
unit_tests: | ||
needs: [build, setup_build_matrix] | ||
uses: ./.github/workflows/unit-tests.yml | ||
Check failure on line 117 in .github/workflows/build-foam.yml GitHub Actions / .github/workflows/build-foam.ymlInvalid workflow file
|
||
integration_tests: | ||
needs: [build, unit_tests, setup_build_matrix] | ||
uses: ./.github/workflows/integration-tests.yml | ||
with: | ||
path: ${{ matrix.OF.path }} | ||
version: ${{ matrix.OF.version }} | ||
cyclic_case: ${{ matrix.OF.cyclic_case }} | ||
foam_user_libbin: ${{ matrix.OF.foam_user_libbin }} | ||
strategy: | ||
fail-fast: false | ||
matrix: ${{ fromJson(needs.setup_build_matrix.outputs.matrix) }} |