Skip to content

Commit

Permalink
pass matrix via inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
greole committed Sep 29, 2023
1 parent 401206a commit ed9cdc9
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 64 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/build-foam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ jobs:
fork: "ESI",
path: "openfoam",
repo: "https://develop.openfoam.com/Development/openfoam.git",
cyclic_case: "LES/periodicPlaneChannel"
},
{
version: "10",
fork: "Foundation",
path: "OpenFOAM-10",
repo: "https://github.com/OpenFOAM/OpenFOAM-10.git",
cyclic_case: "LES/channel395"
}
# ,
# {
Expand All @@ -63,7 +65,7 @@ jobs:
]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Get Ginkgo checkout version
shell: bash
Expand Down Expand Up @@ -96,10 +98,10 @@ jobs:
mkdir -p $FOAM_USER_LIBBIN
mkdir build
cd build
[ -d "/github/home/$GINKGO_CHECKOUT_VERSION" ] && cp -r /github/home/$GINKGO_CHECKOUT_VERSION third_party
[ -f "/github/home/libbin/libginkgo.so" ] && cp -r /github/home/libbin/libginkgo* $FOAM_USER_LIBBIN
[ -d "/github/home/libbin/cmake" ] && cp -r /github/home/libbin/cmake $FOAM_USER_LIBBIN
[ -d "/github/home/libbin/pkgconfig" ] && cp -r /github/home/libbin/pkgconfig $FOAM_USER_LIBBIN
[ -d "/github/home/$GINKGO_CHECKOUT_VERSION" ] && cp -rp /github/home/$GINKGO_CHECKOUT_VERSION third_party
[ -f "/github/home/libbin/libginkgo.so" ] && cp -rp /github/home/libbin/libginkgo* $FOAM_USER_LIBBIN
[ -d "/github/home/libbin/cmake" ] && cp -rp /github/home/libbin/cmake $FOAM_USER_LIBBIN
[ -d "/github/home/libbin/pkgconfig" ] && cp -rp /github/home/libbin/pkgconfig $FOAM_USER_LIBBIN
cmake -G Ninja -DOGL_DATA_VALIDATION=On -DOGL_ALLOW_REFERENCE_ONLY=On -DCMAKE_BUILD_TYPE=$BUILD_TYPE ..
- name: Build OGL
Expand Down Expand Up @@ -133,7 +135,9 @@ jobs:
name: ogl_build_${{ matrix.OF.path }}
path: ${{github.workspace}}/build


tests:
needs: build-ogl
uses: ./.github/workflows/integration-tests.yml
- name: Call integration tests
uses: ./.github/workflows/integration-tests.yml
with:
path: ${{matrix.path}}
version: ${{matrix.version}}
cyclic_case: ${{matrix.cyclic_case}}
93 changes: 38 additions & 55 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
name: Integration Tests
on: ["workflow_call"]
on:
workflow_call:
inputs:
path:
required: true
type: string
version:
required: true
type: string
cyclic_case:
required: true
type: string
run-name: Integration test on ${{github.ref_name}}

env:
Expand Down Expand Up @@ -29,17 +40,6 @@ jobs:
strategy:
fail-fast: false
matrix:
OF: [
{
version: "v2212",
path: "openfoam",
cyclic_case: "LES/periodicPlaneChannel"
},
{
version: "10",
path: "OpenFOAM-10",
cyclic_case: "LES/channel395"
}]
Case: ["cavity", "channel"]

steps:
Expand All @@ -55,21 +55,21 @@ jobs:
- name: Source OF enviroment
run: |
mkdir -p $FOAM_INST_DIR
echo "FOAM_ETC=$FOAM_INST_DIR/${{matrix.OF.path}}/etc" >> $GITHUB_ENV
echo "WM_PROJECT_DIR=$FOAM_INST_DIR/${{matrix.OF.path}}" >> $GITHUB_ENV
echo "FOAM_USER_PATH=$FOAM_INST_DIR/root-${{matrix.OF.version}}" >> $GITHUB_ENV
echo "FOAM_TUTORIALS=$FOAM_INST_DIR/${{matrix.OF.path}}/tutorials" >> $GITHUB_ENV
echo "FOAM_USER_LIBBIN=$FOAM_INST_DIR/root-${{matrix.OF.version}}/platforms/linux64GccDPInt32Opt/lib" >> $GITHUB_ENV
echo "FOAM_SRC=$FOAM_INST_DIR/${{matrix.OF.path}}/src" >> $GITHUB_ENV
echo "Ginkgo_DIR=${{env.FOAM_INST_DIR}}/root-${{matrix.OF.version}}/platforms/linux64GccDPInt32Opt/lib/cmake/Ginkgo" >> $GITHUB_ENV
echo "FOAM_ETC=$FOAM_INST_DIR/${{inputs.path}}/etc" >> $GITHUB_ENV
echo "WM_PROJECT_DIR=$FOAM_INST_DIR/${{inputs.path}}" >> $GITHUB_ENV
echo "FOAM_USER_PATH=$FOAM_INST_DIR/root-${{inputs.version}}" >> $GITHUB_ENV
echo "FOAM_TUTORIALS=$FOAM_INST_DIR/${{inputs.path}}/tutorials" >> $GITHUB_ENV
echo "FOAM_USER_LIBBIN=$FOAM_INST_DIR/root-${{inputs.version}}/platforms/linux64GccDPInt32Opt/lib" >> $GITHUB_ENV
echo "FOAM_SRC=$FOAM_INST_DIR/${{inputs.path}}/src" >> $GITHUB_ENV
echo "Ginkgo_DIR=${{env.FOAM_INST_DIR}}/root-${{inputs.version}}/platforms/linux64GccDPInt32Opt/lib/cmake/Ginkgo" >> $GITHUB_ENV
echo "GINKGO_EXECUTOR=reference" >> $GITHUB_ENV
echo "CYCLIC_CASE=${{matrix.OF.cyclic_case}}" >> $GITHUB_ENV
echo "CYCLIC_CASE=${{inputs.cyclic_case}}" >> $GITHUB_ENV
echo "OMPI_MCA_btl_vader_single_copy_mechanism=none" >> $GITHUB_ENV
- name: Cache OpenFOAM
uses: actions/cache@v3
with:
key: ${{ matrix.OF.path }}-${{env.GINKGO_CHECKOUT_VERSION}}
key: ${{ inputs.path }}-${{env.GINKGO_CHECKOUT_VERSION}}
path: /home/runner/work/_temp/_github_home

- name: Cache Workspace
Expand All @@ -96,18 +96,6 @@ jobs:
needs: setup
strategy:
fail-fast: false
matrix:
OF: [
{
version: "v2212",
path: "openfoam",
cyclic_case: "LES/periodicPlaneChannel"
},
{
version: "10",
path: "OpenFOAM-10",
cyclic_case: "LES/channel395"
}]
Case: ["cavity", "channel"]

steps:
Expand All @@ -123,21 +111,21 @@ jobs:
- name: Source OF enviroment
run: |
mkdir -p $FOAM_INST_DIR
echo "FOAM_ETC=$FOAM_INST_DIR/${{matrix.OF.path}}/etc" >> $GITHUB_ENV
echo "WM_PROJECT_DIR=$FOAM_INST_DIR/${{matrix.OF.path}}" >> $GITHUB_ENV
echo "FOAM_USER_PATH=$FOAM_INST_DIR/root-${{matrix.OF.version}}" >> $GITHUB_ENV
echo "FOAM_TUTORIALS=$FOAM_INST_DIR/${{matrix.OF.path}}/tutorials" >> $GITHUB_ENV
echo "FOAM_USER_LIBBIN=$FOAM_INST_DIR/root-${{matrix.OF.version}}/platforms/linux64GccDPInt32Opt/lib" >> $GITHUB_ENV
echo "FOAM_SRC=$FOAM_INST_DIR/${{matrix.OF.path}}/src" >> $GITHUB_ENV
echo "Ginkgo_DIR=${{env.FOAM_INST_DIR}}/root-${{matrix.OF.version}}/platforms/linux64GccDPInt32Opt/lib/cmake/Ginkgo" >> $GITHUB_ENV
echo "FOAM_ETC=$FOAM_INST_DIR/${{inputs.path}}/etc" >> $GITHUB_ENV
echo "WM_PROJECT_DIR=$FOAM_INST_DIR/${{inputs.path}}" >> $GITHUB_ENV
echo "FOAM_USER_PATH=$FOAM_INST_DIR/root-${{inputs.version}}" >> $GITHUB_ENV
echo "FOAM_TUTORIALS=$FOAM_INST_DIR/${{inputs.path}}/tutorials" >> $GITHUB_ENV
echo "FOAM_USER_LIBBIN=$FOAM_INST_DIR/root-${{inputs.version}}/platforms/linux64GccDPInt32Opt/lib" >> $GITHUB_ENV
echo "FOAM_SRC=$FOAM_INST_DIR/${{inputs.path}}/src" >> $GITHUB_ENV
echo "Ginkgo_DIR=${{env.FOAM_INST_DIR}}/root-${{inputs.version}}/platforms/linux64GccDPInt32Opt/lib/cmake/Ginkgo" >> $GITHUB_ENV
echo "GINKGO_EXECUTOR=reference" >> $GITHUB_ENV
echo "CYCLIC_CASE=${{matrix.OF.cyclic_case}}" >> $GITHUB_ENV
echo "CYCLIC_CASE=${{inputs.cyclic_case}}" >> $GITHUB_ENV
echo "OMPI_MCA_btl_vader_single_copy_mechanism=none" >> $GITHUB_ENV
- name: Cache OpenFOAM
uses: actions/cache@v3
with:
key: ${{ matrix.OF.path }}-${{env.GINKGO_CHECKOUT_VERSION}}
key: ${{ inputs.path }}-${{env.GINKGO_CHECKOUT_VERSION}}
path: /home/runner/work/_temp/_github_home

- name: Cache Workspace
Expand Down Expand Up @@ -168,22 +156,17 @@ jobs:
strategy:
fail-fast: false
matrix:
OF: [
{
version: "v2212",
path: "openfoam",
cyclic_case: "LES/periodicPlaneChannel"
},
{
version: "10",
path: "OpenFOAM-10",
cyclic_case: "LES/channel395"
}]
Case: ["cavity", "channel"]

steps:
- uses: actions/checkout@v4

- name: Cache Workspace
uses: actions/cache@v3
with:
key: ws-${{ github.run_id }}-${{ github.run_attempt }}
path: /home/runner/work/_temp/_github_home/${{matrix.Case}}

- name: Get Ginkgo checkout version
shell: bash
run: |
Expand All @@ -194,7 +177,7 @@ jobs:
- name: Cache OpenFOAM
uses: actions/cache@v3
with:
key: ${{ matrix.OF.path }}-${{env.GINKGO_CHECKOUT_VERSION}}
key: ${{ inputs.path }}-${{env.GINKGO_CHECKOUT_VERSION}}
path: /home/runner/work/_temp/_github_home

- name: Get status
Expand All @@ -218,5 +201,5 @@ jobs:
uses: actions/upload-artifact@v3
if: failure()
with:
name: ogl_integration_${{ matrix.OF.path }}
name: ogl_integration_${{ inputs.path }}
path: /github/home

0 comments on commit ed9cdc9

Please sign in to comment.