Skip to content

Commit

Permalink
Merge pull request #48 from gerlero/openfoam2206
Browse files Browse the repository at this point in the history
Support OpenFOAM v2206
  • Loading branch information
gerlero authored Jun 29, 2022
2 parents 5499884 + 07db9d8 commit 9ba3cdf
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 73 deletions.
86 changes: 86 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Build and test

on:
workflow_call:
inputs:
openfoam-version:
type: string
required: true
app-version:
type: string
default: ${{ github.ref_name }}
required: false
release:
type: boolean
default: false
required: false

jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache DMG file
id: cache_dmg
uses: actions/cache@v3
with:
path: |
build/*.dmg
!build/*-build.dmg
key: dmg-${{ inputs.openfoam-version }}-${{ runner.arch }}-${{ hashFiles('Brewfile', 'configure.sh', 'icon.icns', 'Makefile', format('OpenFOAM-v${0}.tgz.sha256', inputs.openfoam-version)) }}
- name: Reuse cached DMG
if: steps.cache_dmg.outputs.cache-hit == 'true'
run: |
touch build/*.dmg
- name: Build
run: |
make zip OPENFOAM_VERSION=${{ inputs.openfoam-version }} APP_VERSION=${{ inputs.app-version }}
- name: Upload ZIP artifact
uses: actions/upload-artifact@v3
with:
name: zip-${{ inputs.openfoam-version }}
path: build/*-app-*.zip
if-no-files-found: error

test:
needs: build
strategy:
matrix:
os: [macos-10.15, macos-11, macos-12]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download ZIP artifact
uses: actions/download-artifact@v3
with:
name: zip-${{ inputs.openfoam-version }}
path: build
- name: Unzip app
run: |
unzip *-app-$(uname -m).zip
working-directory: build
- name: Test
run: |
make install-dependencies OPENFOAM_VERSION=${{ inputs.openfoam-version }}
make test OPENFOAM_VERSION=${{ inputs.openfoam-version }}
release:
if: inputs.release == 'true'
needs: test
runs-on: ubuntu-latest
steps:
- name: Download ZIP artifact
uses: actions/download-artifact@v3
with:
name: zip-${{ inputs.openfoam-version }}
- name: Upload ZIP to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: '*.zip'
tag: ${{ github.ref }}
file_glob: true
overwrite: false
66 changes: 12 additions & 54 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,60 +7,18 @@ on:
pull_request:
branches:
- main
workflow_call:
inputs:
app-version:
type: string
required: true

jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache DMG file
id: cache_dmg
uses: actions/cache@v3
with:
path: |
build/*.dmg
!build/*-build.dmg
key: dmg-${{ runner.arch }}-${{ hashFiles('Brewfile', 'configure.sh', 'icon.icns', 'Makefile', 'OpenFOAM-v2112.tgz.sha256') }}
- name: Reuse cached DMG
if: steps.cache_dmg.outputs.cache-hit == 'true'
run: |
touch build/*.dmg
- name: Build
run: |
make zip APP_VERSION=${{ inputs.app-version }}
- name: Upload ZIP artifact
uses: actions/upload-artifact@v3
with:
name: zip
path: build/*-app-*.zip
if-no-files-found: error
openfoam2206:
name: OpenFOAM-v2206.app
uses: ./.github/workflows/build-test.yml
with:
openfoam-version: 2206
release: false

test:
needs: build
strategy:
matrix:
os: [macos-10.15, macos-11, macos-12]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download ZIP artifact
uses: actions/download-artifact@v3
with:
name: zip
path: build
- name: Unzip app
run: |
unzip *-app-$(uname -m).zip
working-directory: build
- name: Test
run: |
make install-dependencies
make test
openfoam2112:
name: OpenFOAM-v2112.app
uses: ./.github/workflows/build-test.yml
with:
openfoam-version: 2112
release: false
33 changes: 14 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,20 @@ jobs:
id: get_version
uses: battila7/get-version-action@v2

build:
openfoam2206:
needs: get-version
uses: ./.github/workflows/ci.yml
name: OpenFOAM-v2206.app
uses: ./.github/workflows/build-test.yml
with:
openfoam-version: 2206
app-version: needs.get-version.outputs.version

release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download ZIP artifact
uses: actions/download-artifact@v3
with:
name: zip
- name: Upload ZIP to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: '*.zip'
tag: ${{ github.ref }}
file_glob: true
overwrite: true
release: true

openfoam2112:
needs: get-version
name: OpenFOAM-v2112.app
uses: ./.github/workflows/build-test.yml
with:
openfoam-version: 2112
app-version: needs.get-version.outputs.version
release: true
1 change: 1 addition & 0 deletions OpenFOAM-v2206.tgz.sha256
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
db95eda4afb97ca870733b2d4201ef539099d0778e3f3eca9a075d4f1a0eea46 OpenFOAM-v2206.tgz

0 comments on commit 9ba3cdf

Please sign in to comment.