Skip to content

Commit

Permalink
Merge pull request #1129 from GMLC-TDC/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
phlptp authored Mar 7, 2020
2 parents 5df5a2e + 2374227 commit e80b64f
Show file tree
Hide file tree
Showing 593 changed files with 11,601 additions and 7,800 deletions.
20 changes: 2 additions & 18 deletions .ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ jobs:
- job: Windows
strategy:
matrix:
VS2015-64bit:
imageName: "vs2015-win2012r2"
langArch: "x64"
vsArch: "x64"
VS2017-32bit:
imageName: "vs2017-win2016"
langArch: "x86"
Expand All @@ -25,26 +21,17 @@ jobs:
# -----------------------
# Install dependencies
# -----------------------
- powershell: |
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
echo "##vso[task.prependpath]C:\\ProgramData\\chocolatey\\bin"
choco install boost-msvc-14.1 cmake --yes --limit-output
echo "##vso[task.prependpath]C:\\Program Files\\CMake\\bin"
condition: eq( variables['imageName'], 'vs2015-win2012r2' )
displayName: Install chocolatey, boost, and newer cmake
- bash: choco install swig --yes --limit-output
condition: eq( variables['Agent.OS'], 'Windows_NT' )
displayName: Install swig

- task: UsePythonVersion@0
inputs:
versionSpec: '3.5'
addToPath: true
architecture: $(langArch)
condition: ne( variables['imageName'], 'vs2015-win2012r2' )

- bash: pip3 install pytest
condition: ne( variables['imageName'], 'vs2015-win2012r2' )
displayName: Install pytest

# -----------------------
Expand All @@ -66,7 +53,7 @@ jobs:
inputs:
cmakeArgs: -DBUILD_JAVA_INTERFACE=ON .
displayName: 'Configure Java interface'
condition: and(ne( variables['imageName'], 'vs2015-win2012r2' ), eq( variables['langArch'], 'x64' ))
condition: eq( variables['langArch'], 'x64' )

# -----------------------
# Build HELICS
Expand All @@ -84,20 +71,17 @@ jobs:
"${cpack_dir}/cpack" -G "NSIS" -C Release -B "$PWD/installer-output"
displayName: 'Package HELICS'
workingDirectory: build
condition: ne( variables['imageName'], 'vs2015-win2012r2' )
- task: CopyFiles@2
inputs:
sourceFolder: '$(Build.SourcesDirectory)/build/installer-output'
contents: '*.exe'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
condition: ne( variables['imageName'], 'vs2015-win2012r2' )

- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: installer
condition: ne( variables['imageName'], 'vs2015-win2012r2' )

# -----------------------
# Test HELICS
Expand Down
13 changes: 13 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
freebsd_instance:
image_family: freebsd-12-1

task:
install_script: |
pkg install -y cmake libzmq4 ninja git
build_script: |
mkdir build && cd build
cmake -GNinja -DHELICS_BUILD_TESTS=ON -DHELICS_BUILD_EXAMPLES=ON ..
cmake --build .
test_script: |
cd build
ctest --output-on-failure --timeout 480 -C Release -L "SystemCI"
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ root = true
[*]
end_of_line = lf

[*.bat]
end_of_line = crlf

# HELICS C/C++ source files
[{benchmarks,examples,src,tests}/**.{cpp,hpp,c,h}]
indent_style = space
Expand All @@ -24,4 +27,4 @@ indent_size = 4
# HELICS Root CMakeLists.txt file (avoid matching inside ThirdParty folder)
[./CMakeLists.txt]
indent_style = space
indent_size = 4
indent_size = 4
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
* text=input

*.bat text eol=crlf
*.md text eol=lf
*.json text eol=lf
*.player text eol=lf

*.jpg binary
*.png binary
*.mat binary
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:
# script: |
# github.issues.createComment({...context.issue, body: 'Okay, commit https://github.com/${{ github.repository }}/commit/${{ github.sha }} is being formatted. A PR with the changes will be open soon! :sunglasses:'})
- name: Checkout event Ref
uses: actions/checkout@v1
uses: actions/checkout@v2
if: github.event_name != 'pull_request'
- name: Checkout PR Head Ref
uses: actions/checkout@v1
uses: actions/checkout@v2
if: github.event_name == 'pull_request'
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
Expand Down
98 changes: 73 additions & 25 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,42 @@
name: Build release artifacts

on:
# Handles a 'helics-release-build' dispatch event type
# The event payload should contain these fields:
# packages - a list of which packages to build (everything, archive, msvc, installer, sharedlib)
# commit (optional) - the commit-ish to do a release build with
repository_dispatch:
schedule:
- cron: '15 09 * * *' # Run at in the early hours of the morning (UTC)
release:
types: published

jobs:
################################
#####################################
# Create all submodules archive
################################
#####################################
create-all-submodule-archive:
name: Create all submodule archive
runs-on: ubuntu-latest
if: github.event.action == 'published'
if: (github.event.action == 'published') || (github.event.action == 'helics-release-build' && (contains(github.event.client_payload.packages, 'archive') || contains(github.event.client_payload.packages, 'everything')))
steps:
- uses: actions/checkout@v1
- name: Checkout event ref
uses: actions/checkout@v2
with:
ref: ${{ github.event.client_payload.commit }}
if: github.event.action == 'published' || github.event.action == 'helics-release-build'

- name: Create archive
if: github.event.action != 'helics-release-build'
# Creates the archive then moves it to an artifact subfolder
run: ./scripts/_git-all-archive.sh -l "$(git rev-parse --abbrev-ref "${GITHUB_REF}")" && mkdir artifact && mv "Helics-$(git rev-parse --abbrev-ref "${GITHUB_REF}")-source.tar.gz" artifact/

- name: Create archive (no version)
if: github.event.action == 'helics-release-build'
# Creates the archive then moves it to an artifact subfolder
run: ./scripts/_git-all-archive.sh && mkdir artifact && mv "Helics-source.tar.gz" artifact/

- name: Upload archive to release
if: github.event.action != 'helics-release-build'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UPLOAD_URL: ${{ github.event.release.upload_url }}
Expand All @@ -33,11 +48,12 @@ jobs:
name: all-submodules-archive
path: artifact

################################
#####################################
# Build MSVC archives
################################
#####################################
build-windows-msvc:
runs-on: ${{ matrix.os }}
if: (github.event.action != 'helics-release-build') || (contains(github.event.client_payload.packages, 'msvc') || contains(github.event.client_payload.packages, 'everything'))
strategy:
matrix:
os: [windows-2016, windows-latest]
Expand All @@ -51,11 +67,13 @@ jobs:
msvc_ver: 'msvc2019'
steps:
- name: Checkout event ref
uses: actions/checkout@v1
if: github.event.action == 'published'
uses: actions/checkout@v2
with:
ref: ${{ github.event.client_payload.commit }}
if: github.event.action == 'published' || github.event.action == 'helics-release-build'

- name: Checkout develop branch
uses: actions/checkout@v1
uses: actions/checkout@v2
with:
ref: develop
if: github.event_name == 'schedule'
Expand Down Expand Up @@ -90,23 +108,30 @@ jobs:
name: ${{ runner.os }}-installers
path: artifact

################################
#####################################
# Build installers
################################
#####################################
build-installers:
runs-on: ${{ matrix.os }}
name: Build ${{ matrix.os }} ${{ matrix.arch }} ${{ matrix.cpack_gen }} Installer
if: (github.event.action != 'helics-release-build') || (contains(github.event.client_payload.packages, 'installer') || contains(github.event.client_payload.packages, 'everything'))
strategy:
matrix:
id: [windows-x64, macos-x64-zip, linux-x64]
id: [windows-x64, windows-x86, macos-x64, linux-x64]
include:
- id: windows-x64
os: windows-latest
arch: x64
cpack_gen: NSIS;ZIP
cmake_gen: 'Visual Studio 16 2019'
msvc_ver: 'msvc2019'
- id: macos-x64-zip
- id: windows-x86
os: windows-latest
arch: x86
cpack_gen: ZIP
cmake_gen: 'Visual Studio 16 2019'
msvc_ver: 'msvc2019'
- id: macos-x64
os: macos-latest
arch: x64
cpack_gen: ZIP
Expand All @@ -118,11 +143,13 @@ jobs:

steps:
- name: Checkout event ref
uses: actions/checkout@v1
if: github.event.action == 'published'
uses: actions/checkout@v2
with:
ref: ${{ github.event.client_payload.commit }}
if: github.event.action == 'published' || github.event.action == 'helics-release-build'

- name: Checkout develop branch
uses: actions/checkout@v1
uses: actions/checkout@v2
with:
ref: develop
if: github.event_name == 'schedule'
Expand Down Expand Up @@ -172,11 +199,12 @@ jobs:
name: ${{ runner.os }}-installers
path: artifact

################################
#####################################
# Build shared libraries
################################
#####################################
build-sharedlibs:
runs-on: ${{ matrix.os }}
if: (github.event.action != 'helics-release-build') || (contains(github.event.client_payload.packages, 'sharedlib') || contains(github.event.client_payload.packages, 'everything'))
name: Build ${{ matrix.os }} ${{ matrix.arch }} Shared Library
strategy:
matrix:
Expand All @@ -202,11 +230,13 @@ jobs:

steps:
- name: Checkout event ref
uses: actions/checkout@v1
if: github.event.action == 'published'
uses: actions/checkout@v2
with:
ref: ${{ github.event.client_payload.commit }}
if: github.event.action == 'published' || github.event.action == 'helics-release-build'

- name: Checkout develop branch
uses: actions/checkout@v1
uses: actions/checkout@v2
with:
ref: develop
if: github.event_name == 'schedule'
Expand Down Expand Up @@ -248,16 +278,16 @@ jobs:
name: ${{ runner.os }}-installers
path: artifact

################################
#####################################
# Generate SHA-256 file
################################
#####################################
generate-sha256:
name: Calculate SHA256 for release assets
needs: [create-all-submodule-archive, build-installers, build-sharedlibs, build-windows-msvc]
runs-on: ubuntu-latest
if: github.event.action == 'published'
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2

- name: Get all submodules archive
uses: actions/download-artifact@v1
Expand Down Expand Up @@ -291,3 +321,21 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UPLOAD_URL: ${{ github.event.release.upload_url }}
run: ./.github/workflows/upload-release-asset.sh "artifacts/Helics-$(git rev-parse --abbrev-ref "${GITHUB_REF}")-SHA-256.txt"

#####################################
# Send helics-version-update event(s)
#####################################
send-version-update-event:
name: Send helics-version-update event(s)
needs: [generate-sha256]
runs-on: ubuntu-latest
if: github.event.action == 'published'
steps:
- name: Send event to helics-packaging
run: |
HELICS_REPO="${{ github.repository }}"
HELICS_VERSION="${{ github.event.release.tag_name }}"
curl -X POST --header 'authorization: Bearer ${{ secrets.HELICS_BOT_TOKEN }}' \
--url https://api.github.com/repos/GMLC-TDC/helics-packaging/dispatches \
--header 'content-type: application/json' \
--data "{\"event_type\":\"helics-version-update\",\"client_payload\":{\"repository\":\"${HELICS_REPO}\",\"tag_name\":\"${HELICS_VERSION}\",\"version\":\"${HELICS_VERSION#v}\"}}"
2 changes: 1 addition & 1 deletion .github/workflows/release-build/installer-Linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#rm cmake-install.sh

mkdir build && cd build || exit
cmake -DCMAKE_BUILD_TYPE=Release -DHELICS_ZMQ_SUBPROJECT=ON -DHELICS_ENABLE_PACKAGE_BUILD=ON -DSTATIC_STANDARD_LIB=static -DHELICS_BUILD_EXAMPLES=OFF -DHELICS_BUILD_APP_EXECUTABLES=ON -DHELICS_BUILD_APP_LIBRARY=ON -DHELICS_ENABLE_WEBSERVER=ON -DBUILD_TESTING=OFF ..
cmake -DCMAKE_BUILD_TYPE=Release -DHELICS_ZMQ_SUBPROJECT=ON -DHELICS_ENABLE_PACKAGE_BUILD=ON -DSTATIC_STANDARD_LIB=static -DHELICS_BUILD_EXAMPLES=OFF -DHELICS_BUILD_APP_EXECUTABLES=ON -DHELICS_BUILD_APP_LIBRARY=ON -DBUILD_TESTING=OFF ..
cmake --build . --config Release
cpack_dir="$(command -v cmake)"
cpack_dir="${cpack_dir%/cmake}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-build/installer-Windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
echo "Building ${CPACK_GEN} installer with ${BUILD_GEN} for ${BUILD_ARCH}"
choco install -y swig
mkdir build && cd build || exit
cmake -G "${BUILD_GEN}" -A "${BUILD_ARCH/x86/Win32}" -DCMAKE_BUILD_TYPE=Release -DHELICS_ENABLE_PACKAGE_BUILD=ON -DBUILD_PYTHON_INTERFACE=ON -DBUILD_JAVA_INTERFACE=ON -DSTATIC_STANDARD_LIB=static -DHELICS_USE_ZMQ_STATIC_LIBRARY=ON -DHELICS_BUILD_EXAMPLES=OFF -DHELICS_BUILD_APP_EXECUTABLES=ON -DHELICS_BUILD_APP_LIBRARY=ON -DHELICS_ENABLE_WEBSERVER=ON -DBUILD_TESTING=OFF ..
cmake -G "${BUILD_GEN}" -A "${BUILD_ARCH/x86/Win32}" -DCMAKE_BUILD_TYPE=Release -DHELICS_ENABLE_PACKAGE_BUILD=ON -DBUILD_PYTHON_INTERFACE=ON -DBUILD_JAVA_INTERFACE=ON -DSTATIC_STANDARD_LIB=static -DHELICS_USE_ZMQ_STATIC_LIBRARY=ON -DHELICS_BUILD_EXAMPLES=OFF -DHELICS_BUILD_APP_EXECUTABLES=ON -DHELICS_BUILD_APP_LIBRARY=ON -DBUILD_TESTING=OFF ..
cmake --build . --config Release
cpack_dir="$(command -v cmake)"
cpack_dir="${cpack_dir%/cmake}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-build/installer-macOS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

brew install swig boost
mkdir build && cd build || exit
cmake -DCMAKE_BUILD_TYPE=Release -DHELICS_ZMQ_SUBPROJECT=ON -DHELICS_ENABLE_PACKAGE_BUILD=ON -DBUILD_PYTHON_INTERFACE=ON -DBUILD_JAVA_INTERFACE=ON -DHELICS_BUILD_EXAMPLES=OFF -DHELICS_BUILD_APP_EXECUTABLES=ON -DHELICS_BUILD_APP_LIBRARY=ON -DHELICS_ENABLE_WEBSERVER=ON -DBUILD_TESTING=OFF ..
cmake -DCMAKE_BUILD_TYPE=Release -DHELICS_ZMQ_SUBPROJECT=ON -DHELICS_ENABLE_PACKAGE_BUILD=ON -DBUILD_PYTHON_INTERFACE=ON -DBUILD_JAVA_INTERFACE=ON -DHELICS_BUILD_EXAMPLES=OFF -DHELICS_BUILD_APP_EXECUTABLES=ON -DHELICS_BUILD_APP_LIBRARY=ON -DBUILD_TESTING=OFF ..
cmake --build . --config Release
cpack_dir="$(command -v cmake)"
cpack_dir="${cpack_dir%/cmake}"
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/swig-interface-gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ jobs:
image: helics/buildenv:interface-gen

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Run SWIG
run: |
rm -rf interfaces/*/interface/*
mkdir build_matlab
pushd build_matlab
cmake -DBUILD_MATLAB_INTERFACE=ON -DHELICS_SWIG_GENERATE_INTERFACE_FILES_ONLY=ON -DHELICS_OVERWRITE_INTERFACE_FILES=ON -DHELICS_BUILD_EXAMPLES=OFF -DENABLE_ZMQ_CORE=OFF -DHELICS_BUILD_TESTS=OFF -DHELICS_BUILD_APP_EXECUTABLES=OFF -DHELICS_DISABLE_BOOST=ON -DHELICS_ENABLE_SWIG=ON -DSWIG_EXECUTABLE=/root/swig-matlab/bin/swig ..
Expand All @@ -30,13 +31,7 @@ jobs:
popd
- name: Stage changed interface files
shell: bash --noprofile --norc {0}
run: |
git diff --name-only | grep -E 'interfaces/*'
if [[ "$?" == "0" ]];
then
git add interfaces/
fi
exit 0
run: git add interfaces/
- uses: ./.github/actions/create-file-update-pr
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@
[submodule "ThirdParty/toml11"]
path = ThirdParty/toml11
url = https://github.com/GMLC-TDC/toml11.git
[submodule "ThirdParty/netif"]
path = ThirdParty/netif
url = https://github.com/GMLC-TDC/netif.git
Loading

0 comments on commit e80b64f

Please sign in to comment.