nightly-linux #1125
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: Nightly Release | |
on: | |
workflow_dispatch: | |
inputs: | |
perform-nightly: | |
description: Prepare nightly tag and release | |
type: boolean | |
default: true | |
perform-linux: | |
description: Build Linux release | |
type: boolean | |
default: true | |
perform-windows: | |
description: Build Windows release | |
type: boolean | |
default: true | |
perform-nrt: | |
description: Run NRT on Windows | |
type: boolean | |
default: true | |
perform-dispatch: | |
description: Tell dynaflow-launcher the nightly release is ready | |
type: boolean | |
default: true | |
repository_dispatch: | |
types: [nightly-linux, nightly-windows] | |
# schedule: | |
# - cron: "0 4 * * 2-6" # 6 hours later after Dynawo nightly-release.yml | |
env: | |
DYNAWO_VERSION: 1.7.0 | |
DYNAWO_TAG: nightly | |
jobs: | |
nightly: | |
if: github.event_name != 'workflow_dispatch' || inputs.perform-nightly | |
name: Prepare nightly tag and release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch release script | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ github.repository_owner }}/dynawo | |
sparse-checkout: .github/release.js | |
sparse-checkout-cone-mode: false | |
- name: Create nightly tag and release if necessary | |
uses: actions/github-script@v7 | |
env: | |
body: | | |
DynawoAlgorithms's nightly release. Compiled on *release* settings. | |
**Don't use it for production** | |
draft: false | |
prerelease: true | |
release_name: Nightly | |
tag_name: ${{ env.DYNAWO_TAG }} | |
target_commitish: heads/master | |
with: | |
retries: 3 | |
script: | | |
const release = require('.github/release.js') | |
await release({github, context, core, glob}) | |
fedora: | |
if: always() && !cancelled() && !failure() && (github.event.action == 'nightly-linux' || (github.event_name == 'workflow_dispatch' && inputs.perform-linux) || !endsWith(github.event_name, '_dispatch')) | |
name: Linux Fedora (Release, GCC, cxx11) (${{ matrix.use-mpi.text }}) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
use-mpi: | |
- { value: YES, text: 'with MPI' } | |
- { value: NO, text: 'without MPI' } | |
needs: nightly | |
env: | |
DYNAWO_RESULTS_SHOW: "false" | |
DYNAWO_BUILD_TYPE: Release | |
DYNAWO_FORCE_CXX11_ABI: "true" | |
DYNAWO_USE_MPI: ${{ matrix.use-mpi.value }} | |
DYNAWO_NB_PROCESSORS_USED: 2 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Fetch Dynawo's nightly release | |
run: curl -LOs https://github.com/${{ github.repository_owner }}/dynawo/releases/download/nightly/Dynawo_headers_v$DYNAWO_VERSION.zip | |
- name: Unzip Dynawo | |
run: unzip -qq "Dynawo_headers_v${DYNAWO_VERSION}.zip" | |
- name: Build, Build documentation, Prepare files for distribution | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: dynawo/dynawo-distribution-cxx11:latest | |
options: -v ${{ github.workspace }}:/dynawo-algorithms -e DYNAWO_RESULTS_SHOW -e DYNAWO_BUILD_TYPE -e DYNAWO_FORCE_CXX11_ABI -e DYNAWO_NB_PROCESSORS_USED -e DYNAWO_USE_MPI | |
shell: bash | |
run: | | |
cd /dynawo-algorithms | |
export DYNAWO_HOME=$(pwd)/dynawo | |
export DYNAWO_ALGORITHMS_HOME=$(pwd) | |
util/envDynawoAlgorithms.sh build | |
util/envDynawoAlgorithms.sh build-doc | |
util/envDynawoAlgorithms.sh distrib | |
util/envDynawoAlgorithms.sh distrib-headers | |
- name: INFO. Files created in distributions folder | |
run: du -hs distributions/* | |
- name: Fetch release script | |
if: ${{ matrix.use-mpi.value == 'YES' }} | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ github.repository_owner }}/dynawo | |
sparse-checkout: .github/release.js | |
sparse-checkout-cone-mode: false | |
path: dynawo | |
- name: Upload assets for release | |
if: ${{ matrix.use-mpi.value == 'YES' }} | |
uses: actions/github-script@v7 | |
env: | |
tag_name: ${{ env.DYNAWO_TAG }} | |
draft: false | |
prerelease: true | |
files: | | |
distributions/*.zip | |
documentation/dynawoAlgorithmsDocumentation/DynawoAlgorithmsDocumentation.pdf | |
with: | |
retries: 3 | |
script: | | |
const release = require('./dynawo/.github/release.js') | |
await release({github, context, core, glob}) | |
# The secrets.DISPATCH_TOKEN should contain a fine-grained PAT with access to dynawo/dynaflow-launcher with Repository permissions 'Contents: Read and write' | |
- name: Tell dynaflow-launcher the nightly release is ready | |
if: matrix.use-mpi.value == 'YES' && (github.event_name != 'workflow_dispatch' || inputs.perform-dispatch) | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.DISPATCH_TOKEN }} | |
script: | | |
await github.rest.repos.createDispatchEvent({ owner: context.repo.owner, repo: "dynaflow-launcher", event_type: "nightly-linux" }); | |
windows: | |
if: always() && !cancelled() && !failure() && (github.event.action == 'nightly-windows' || (github.event_name == 'workflow_dispatch' && inputs.perform-windows) || !endsWith(github.event_name, '_dispatch')) | |
name: Windows 2019 (Release, VS2019) (${{ matrix.use-mpi.text }}) | |
runs-on: windows-2019 | |
strategy: | |
matrix: | |
use-mpi: | |
- { value: YES, text: 'with MPI' } | |
- { value: NO, text: 'without MPI' } | |
needs: nightly | |
env: | |
DYNAWO_USE_MPI: ${{ matrix.use-mpi.value }} | |
steps: | |
- name: No LF to CRLF conversion | |
shell: cmd | |
run: git config --global core.autocrlf input | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Download MS-MPI | |
if: ${{ matrix.use-mpi.value == 'YES' }} | |
shell: bash | |
run: | | |
curl -Os https://download.microsoft.com/download/a/5/2/a5207ca5-1203-491a-8fb8-906fd68ae623/msmpisdk.msi | |
curl -Os https://download.microsoft.com/download/a/5/2/a5207ca5-1203-491a-8fb8-906fd68ae623/msmpisetup.exe | |
- name: Install MS-MPI | |
if: ${{ matrix.use-mpi.value == 'YES' }} | |
shell: cmd | |
run: | | |
msmpisdk.msi /passive | |
msmpisetup.exe /unattend | |
- name: Fetch Dynawo's nightly release | |
shell: bash | |
run: curl -LOs https://github.com/${{ github.repository_owner }}/dynawo/releases/download/nightly/Dynawo_Windows_v$DYNAWO_VERSION.zip | |
- name: Unzip Dynawo | |
shell: cmd | |
run: 7z x Dynawo_Windows_v%DYNAWO_VERSION%.zip -o..\deploy | |
- name: Dynawo version | |
shell: cmd | |
run: ..\deploy\dynawo\dynawo version | |
# use a minimal PATH to avoid too long command lines and conflict with Strawberry pkg-config ! | |
- name: Build and install | |
shell: cmd | |
env: | |
PATH: C:\Windows\system32;C:\Program Files\Git\cmd;C:\hostedtoolcache\windows\Python\3.7.9\x64 | |
run: | | |
if "${{ matrix.use-mpi.value }}" == "YES" ( | |
set "MSMPI_INC=C:\Program Files (x86)\Microsoft SDKs\MPI\Include\" | |
set "MSMPI_LIB32=C:\Program Files (x86)\Microsoft SDKs\MPI\Lib\x86\" | |
set "MSMPI_LIB64=C:\Program Files (x86)\Microsoft SDKs\MPI\Lib\x64\" | |
) | |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | |
call util\windows\dynawo-algorithms verbose build || exit /b 1 | |
- name: Dynawo-algorithms version | |
shell: cmd | |
env: | |
PATH: C:\Windows\system32;C:\Program Files\Git\cmd;C:\hostedtoolcache\windows\Python\3.7.9\x64 | |
run: call ..\da-i\dynawo-algorithms verbose version || exit /b 1 | |
- name: Run NRT | |
if: matrix.use-mpi.value == 'YES' && (github.event_name != 'workflow_dispatch' || inputs.perform-nrt) | |
shell: cmd | |
env: | |
MSMPI_BENCHMARKS: C:\Program Files\Microsoft MPI\Benchmarks\ | |
MSMPI_BIN: C:\Program Files\Microsoft MPI\Bin\ | |
PATH: C:\Windows\system32;C:\Program Files\Git\cmd;C:\hostedtoolcache\windows\Python\3.7.9\x64;C:\hostedtoolcache\windows\Python\3.7.9\x64\Scripts | |
run: | | |
pip install lxml psutil | |
set PATH=%MSMPI_BIN%;%PATH% | |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | |
call util\windows\dynawo-algorithms verbose nrt || exit /b 1 | |
- name: Create distribution | |
shell: cmd | |
env: | |
PATH: C:\Windows\system32;C:\Program Files\Git\cmd;C:\hostedtoolcache\windows\Python\3.7.9\x64 | |
run: | | |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | |
call util\windows\dynawo-algorithms verbose distrib-headers distrib || exit /b 1 | |
- name: INFO. Files created in distrib folder | |
shell: bash | |
run: | | |
du -hs distrib/* | |
if [ "${{ matrix.use-mpi.value }}" == "YES" ]; then | |
for file in distrib/DynawoAlgorithms_*.zip ; do mv $file ${file//headers_Release/Windows} ; done | |
else | |
for file in distrib/DynawoAlgorithms_*.zip ; do mv $file ${file//headers_Release/Windows_without_mpi} ; done | |
fi | |
- name: Fetch release script | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ github.repository_owner }}/dynawo | |
sparse-checkout: .github/release.js | |
sparse-checkout-cone-mode: false | |
path: dynawo | |
- name: Upload distribution | |
uses: actions/github-script@v7 | |
env: | |
tag_name: ${{ env.DYNAWO_TAG }} | |
draft: false | |
prerelease: true | |
files: | | |
distrib/DynawoAlgorithms_*.zip | |
with: | |
retries: 3 | |
script: | | |
const release = require('./dynawo/.github/release.js') | |
await release({github, context, core, glob}) | |
- name: Tell dynaflow-launcher the nightly release is ready | |
if: matrix.use-mpi.value == 'YES' && (github.event_name != 'workflow_dispatch' || inputs.perform-dispatch) | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.DISPATCH_TOKEN }} | |
script: | | |
await github.rest.repos.createDispatchEvent({ owner: context.repo.owner, repo: "dynaflow-launcher", event_type: "nightly-windows" }); |