NeoFOAM Integration Test #1792
This file contains hidden or 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: NeoFOAM Integration Test | |
| run-name: 'NeoFOAM Integration Test' | |
| on: | |
| push: | |
| branches: [develop, main] | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled, unlabeled] | |
| schedule: | |
| - cron: '00 8 * * 0' | |
| workflow_dispatch: | |
| env: | |
| CTEST_OUTPUT_ON_FAILURE: 1 | |
| OMPI_MCA_rmaps_base_oversubscribe: 1 | |
| concurrency: | |
| group: > | |
| ${{ github.workflow }}- | |
| ${{ github.event_name }}- | |
| ${{ github.event.pull_request.number || github.ref_name }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| if: > | |
| github.repository == 'exasim-project/NeoN' && | |
| (github.event_name != 'pull_request' || | |
| !contains(github.event.pull_request.labels.*.name, 'skip-build')) | |
| name: Build NeoFOAM | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| compiler: | |
| - CC: clang | |
| CXX: clang++ | |
| - CC: gcc | |
| CXX: g++ | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Determine branch | |
| run: | | |
| # Detect current branch of NeoN | |
| NEON_BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}}" | |
| echo "Using NeoN branch: $NEON_BRANCH" | |
| echo "NEON_BRANCH=$NEON_BRANCH" >> $GITHUB_ENV | |
| # Define remote repo URL | |
| REPO_URL="https://github.com/exasim-project/NeoFOAM" | |
| echo "Checking if branch '$NEON_BRANCH' exists in NeoFOAM..." | |
| # Query exact match: refs/heads/<branch> | |
| if git ls-remote --exit-code --heads "$REPO_URL" "refs/heads/${NEON_BRANCH}" >/dev/null 2>&1; then | |
| echo "NeoFOAM branch exists: $NEON_BRANCH" | |
| echo "NEOFOAM_BRANCH=$NEON_BRANCH" >> $GITHUB_ENV | |
| else | |
| echo "NeoFOAM branch '$NEON_BRANCH' does not exist. Falling back to 'develop'." | |
| echo "NEOFOAM_BRANCH=develop" >> $GITHUB_ENV | |
| fi | |
| - name: Checkout NeoFOAM | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: exasim-project/NeoFOAM | |
| ref: ${{ env.NEOFOAM_BRANCH }} | |
| fetch-depth: 1 | |
| # Optional NeoN checkout if needed | |
| # - name: Checkout NeoN submodule | |
| # uses: actions/checkout@v4 | |
| # with: | |
| # repository: exasim-project/NeoN | |
| # path: NeoN | |
| # ref: '${{ env.NEON_BRANCH }}' | |
| - name: Set up OpenFOAM | |
| uses: gerlero/setup-openfoam@v1 | |
| with: | |
| openfoam-version: 2406 | |
| - name: Install dependencies | |
| uses: gerlero/apt-install@v1 | |
| with: | |
| packages: >- | |
| ninja-build | |
| clang-16 | |
| gcc-10 | |
| libomp-16-dev | |
| python3 | |
| python3-dev | |
| build-essential | |
| libopenmpi-dev | |
| openmpi-bin | |
| - name: Get versions | |
| run: | | |
| clang --version | |
| ninja --version | |
| cmake --version | |
| - name: Build NeoFOAM | |
| run: | | |
| source /usr/lib/openfoam/openfoam2406/etc/bashrc || true | |
| CC=${{ matrix.compiler.CC }} \ | |
| CXX=${{ matrix.compiler.CXX }} \ | |
| cmake --preset develop \ | |
| -DNeoN_DEVEL_TOOLS=OFF \ | |
| -DNeoN_BUILD_TESTS=OFF \ | |
| -DNEOFOAM_BUILD_BENCHMARKS=OFF \ | |
| -DNeoN_ENABLE_MPI_WITH_THREAD_SUPPORT=OFF \ | |
| -DNEOFOAM_NEON_VERSION=${{ env.NEON_BRANCH }} | |
| cmake --build --preset develop | |
| - name: Execute unit tests NeoN | |
| run: | | |
| source /usr/lib/openfoam/openfoam2406/etc/bashrc || true | |
| ctest --preset develop |