Skip to content

Commit

Permalink
Merge branch 'master' into feature/GRIDEDIT-872_undo_in_meshkernel
Browse files Browse the repository at this point in the history
  • Loading branch information
BillSenior committed Feb 8, 2024
2 parents 81ad032 + 9f6df1e commit 9254c3f
Show file tree
Hide file tree
Showing 46 changed files with 4,393 additions and 1,796 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/build-and-test-feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build and test

on:
push:
branches:
- "feature/**"
pull_request:
types:
- opened # triggers build when opened
- synchronize # triggers build when commits are pushed to HEAD
branches:
- "feature/**"
# Manual trigger
workflow_dispatch:

jobs:

build:

strategy:
fail-fast: false
matrix:
platform:
- macos-12
build_type:
- Release

uses: ./.github/workflows/build-and-test-workflow.yml
with:
platform: ${{ matrix.platform }}
build_type: ${{ matrix.build_type }}
27 changes: 27 additions & 0 deletions .github/workflows/build-and-test-master-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build and test

on:
push:
branches:
- master
- "release/v[0-9].[0-9].[0-9]"
# Manual trigger
workflow_dispatch:

jobs:

build:

strategy:
fail-fast: false
matrix:
platform:
- macos-12
- macos-13-xlarge
build_type:
- Release

uses: ./.github/workflows/build-and-test-workflow.yml
with:
platform: ${{ matrix.platform }}
build_type: ${{ matrix.build_type }}
Original file line number Diff line number Diff line change
@@ -1,42 +1,25 @@
name: Build and test on macos
name: Build and test workflow

on:
push:
branches:
- master
- "release/v[0-9].[0-9].[0-9]"
pull_request:
types:
- opened # triggers build when opened
- synchronize # triggers build when commits are pushed to HEAD
branches:
- master
- "release/v[0-9].[0-9].[0-9]"
- "feature/**"
# Manual trigger
workflow_dispatch:
workflow_call:
inputs:
platform:
description: "Platform"
required: true
type: string
build_type:
description: "Build type"
required: true
type: string

jobs:

build:

# Build strategy
strategy:
fail-fast: false
matrix:
platform:
# - ubuntu-latest
- macos-latest
- macos-13-xlarge
build_type:
- 'Release'
#- 'Debug'
#- 'DebugWithRelInfo '

# Build platform
runs-on: ${{ matrix.platform }}
runs-on: ${{ inputs.platform }}

name: ${{ matrix.platform }}-${{ matrix.build_type }}
name: ${{ inputs.platform }}-${{ inputs.build_type }}

# The default compiler on macos is clang, switch to gcc 11. Specifying the version is necessary.
# It seems like gcc and g++ are symbolic links to the default clang and clang++ compilers, respectively.
Expand All @@ -45,7 +28,7 @@ jobs:
CC: gcc-11
CXX: g++-11

# Build steps
# Build steps
steps:

# Step: Checkout
Expand Down Expand Up @@ -77,8 +60,8 @@ jobs:
uses: actions/cache/restore@v3
id: restore-cached-external-dependencies
with:
key: ${{ runner.os }}-cache-key
restore-keys: ${{ runner.os }}-cache-key
key: ${{ inputs.platform }}-${{ inputs.build_type }}-cache-key
restore-keys: ${{ inputs.platform }}-${{ inputs.build_type }}-cache-key
path: ${{ steps.paths.outputs.ext_deps_dir }}/netcdf-c/install/netcdf-c

# Step: Build and install user-provided dependencies, executes only if no cache restored
Expand All @@ -89,15 +72,15 @@ jobs:
pwsh ${{ github.workspace }}/scripts/install_netcdf_static.ps1
-WorkDir ${{ steps.paths.outputs.ext_deps_dir }}/netcdf-c/work
-InstallDir ${{ steps.paths.outputs.ext_deps_dir }}/netcdf-c/install
-BuildType '${{ matrix.build_type }}'
-BuildType '${{ inputs.build_type }}'
-ParallelJobs 10
# Step: Cache user-provided dependencies, executes only if no cache restored
- name: Cache user-provided dependencies
uses: actions/cache/save@v3
if: runner.os != 'macOS' && steps.restore-cached-external-dependencies.outputs.cache-hit != 'true'
with:
key: ${{ runner.os }}-cache-key
key: ${{ inputs.platform }}-${{ inputs.build_type }}-cache-key
path: ${{ steps.paths.outputs.ext_deps_dir }}/netcdf-c/install/netcdf-c

# Step: CMake configuration
Expand All @@ -106,17 +89,17 @@ jobs:
cmake
-S ${{ github.workspace }}
-B ${{ steps.paths.outputs.build_dir }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_BUILD_TYPE=${{ inputs.build_type }}
-DCMAKE_PREFIX_PATH=${{ steps.paths.outputs.ext_deps_dir }}/netcdf-c/install/netcdf-c
-DCMAKE_INSTALL_PREFIX=${{ steps.paths.outputs.install_dir }}
# Step: CMake build
- name: Build
run: cmake --build ${{ steps.paths.outputs.build_dir }} --config ${{ matrix.build_type }} -j
run: cmake --build ${{ steps.paths.outputs.build_dir }} --config ${{ inputs.build_type }} -j

# Step: Test
# Works if runner.os == 'Linux' or runner.os == 'macOS'
# if runner.os == 'Windows', /matrix.build_type needs to be inserted before /tests
# if runner.os == 'Windows', /inputs.build_type needs to be inserted before /tests
- name: Test
run: |
echo -e "\n*************** MeshKernel Tests ***************\n"
Expand All @@ -133,6 +116,6 @@ jobs:
uses: actions/upload-artifact@v4
if: always()
with:
name: meshkernel-${{ matrix.platform }}-${{ matrix.build_type }}
name: meshkernel-${{ inputs.platform }}-${{ inputs.build_type }}
path: ${{ steps.paths.outputs.install_dir }}
if-no-files-found: error
Loading

0 comments on commit 9254c3f

Please sign in to comment.