Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhjp01 committed May 16, 2024
1 parent 6fe652f commit fd7193e
Showing 1 changed file with 98 additions and 98 deletions.
196 changes: 98 additions & 98 deletions .github/workflows/github-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,57 +6,57 @@ env:
conan_config: "https://gitlab.sintef.no/co-simulation/conan-configs.git"

jobs:
windows:
name: Windows build
runs-on: windows-2022
strategy:
matrix:
TYPE: [Release, Debug]
PROFILE: ["msvc_192"]
steps:
- uses: actions/checkout@v4

- id: cache-conan-packages
uses: actions/cache@v4
with:
path: |
~/.conan2
key: ${{ runner.os }}-${{ matrix.TYPE }}-dds-fmu

- name: Install Conan
id: conan
uses: turtlebrowser/get-conan@main
with:
version: 2.3.0

- name: Setting variables
run: |
if ("${{ matrix.TYPE }}" -like "Debug") { echo "SKIP_TEST=True" >> "$GITHUB_ENV" }
- name: Conan build
run: |
conan config install "${{ env.conan_config }}" --type git -sf profiles -tf profiles
conan config install "${{ env.conan_config }}" --type git -sf remotes_public
conan build -o "dds-fmu/*:with_doc=False" -b missing --update `
-pr:b ${{ matrix.PROFILE }} -pr:h ${{ matrix.PROFILE }} -s build_type=${{ matrix.TYPE }} `
-c tools.build:jobs=2 -c tools.build:skip_test=$SKIP_TEST .
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: "${{ github.job }}-${{ matrix.TYPE }}"
path: |
build/fmus/*
public/*
testoutput/*.xml
retention-days: 1
# windows:
# name: Windows build
# runs-on: windows-2022
# strategy:
# matrix:
# TYPE: [Release, Debug]
# PROFILE: ["msvc_192"]
# steps:
# - uses: actions/checkout@v4
#
# - id: cache-conan-packages
# uses: actions/cache@v4
# with:
# path: |
# ~/.conan2
# key: ${{ runner.os }}-${{ matrix.TYPE }}-dds-fmu
#
# - name: Install Conan
# id: conan
# uses: turtlebrowser/get-conan@main
# with:
# version: 2.3.0
#
# - name: Setting variables
# run: |
# if ("${{ matrix.TYPE }}" -like "Debug") { echo "SKIP_TEST=True" >> "$GITHUB_ENV" }
#
# - name: Conan build
# run: |
# conan config install "${{ env.conan_config }}" --type git -sf profiles -tf profiles
# conan config install "${{ env.conan_config }}" --type git -sf remotes_public
# conan build -o "dds-fmu/*:with_doc=False" -b missing --update `
# -pr:b ${{ matrix.PROFILE }} -pr:h ${{ matrix.PROFILE }} -s build_type=${{ matrix.TYPE }} `
# -c tools.build:jobs=2 -c tools.build:skip_test=$SKIP_TEST .
#
# - name: Upload artifacts
# uses: actions/upload-artifact@v4
# with:
# name: "${{ github.job }}-${{ matrix.TYPE }}"
# path: |
# build/fmus/*
# public/*
# testoutput/*.xml
# retention-days: 1

linux:
name: Linux build
runs-on: ubuntu-22.04
strategy:
matrix:
TYPE: [Debug, Release]
TYPE: [Release]
PROFILE: ["gcc12"]
env:
TARGET: "${{ github.job }}-${{ matrix.TYPE }}"
Expand Down Expand Up @@ -102,67 +102,67 @@ jobs:
retention-days: 1

- name: Upload pages artifact
if: env.TARGET == 'linux-Release' && startsWith(github.ref, 'refs/tags/')
if: env.TARGET == 'linux-Release' # && startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v4
with:
name: github-pages
path: public

fmu:
needs: [linux, windows]
runs-on: ubuntu-22.04
strategy:
matrix:
TYPE: [ Release, Debug ]
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: fmus/
pattern: "*-${{ matrix.TYPE }}"
- name: Build an FMU
run: |
FMU_VERSION=$(cat version.txt)
FMU_NAME=${{ github.event.repository.name }}
shopt -s globstar
mkdir tmp_${{ matrix.TYPE }} && cd tmp_${{ matrix.TYPE }}
the_fmus=(../fmus/**/*${{ matrix.TYPE }}.fmu)
fmu_count=${#the_fmus[@]}
for (( i=0; i<$fmu_count; i++ )); do
an_fmu="${the_fmus[$i]}"
cmake -E tar xf $an_fmu
done
mkdir ../combined_fmus
cmake -E tar cf ../combined_fmus/$FMU_NAME-${{ matrix.TYPE }}.fmu --format=zip .
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: "${{ github.event.repository.name }}-${{ matrix.TYPE }}"
path: |
combined_fmus/${{ github.event.repository.name }}-${{ matrix.TYPE }}.fmu
release:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
needs: [fmu]
runs-on: ubuntu-22.04
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: "${{ github.event.repository.name }}-Release"
- run: |
mv "${{ github.event.repository.name }}-Release/${{ github.event.repository.name }}-Release.fmu" \
"${{ github.event.repository.name }}.fmu"
- name: Release
uses: softprops/action-gh-release@v2
with:
files: "${{ github.event.repository.name }}.fmu"
# fmu:
# needs: [linux, windows]
# runs-on: ubuntu-22.04
# strategy:
# matrix:
# TYPE: [ Release, Debug ]
# steps:
# - uses: actions/checkout@v4
# - name: Download artifacts
# uses: actions/download-artifact@v4
# with:
# path: fmus/
# pattern: "*-${{ matrix.TYPE }}"
# - name: Build an FMU
# run: |
# FMU_VERSION=$(cat version.txt)
# FMU_NAME=${{ github.event.repository.name }}
# shopt -s globstar
# mkdir tmp_${{ matrix.TYPE }} && cd tmp_${{ matrix.TYPE }}
# the_fmus=(../fmus/**/*${{ matrix.TYPE }}.fmu)
# fmu_count=${#the_fmus[@]}
# for (( i=0; i<$fmu_count; i++ )); do
# an_fmu="${the_fmus[$i]}"
# cmake -E tar xf $an_fmu
# done
# mkdir ../combined_fmus
# cmake -E tar cf ../combined_fmus/$FMU_NAME-${{ matrix.TYPE }}.fmu --format=zip .
#
# - name: Upload artifacts
# uses: actions/upload-artifact@v4
# with:
# name: "${{ github.event.repository.name }}-${{ matrix.TYPE }}"
# path: |
# combined_fmus/${{ github.event.repository.name }}-${{ matrix.TYPE }}.fmu
#
# release:
# if: ${{ startsWith(github.ref, 'refs/tags/') }}
# needs: [fmu]
# runs-on: ubuntu-22.04
# steps:
# - name: Download artifacts
# uses: actions/download-artifact@v4
# with:
# pattern: "${{ github.event.repository.name }}-Release"
# - run: |
# mv "${{ github.event.repository.name }}-Release/${{ github.event.repository.name }}-Release.fmu" \
# "${{ github.event.repository.name }}.fmu"
# - name: Release
# uses: softprops/action-gh-release@v2
# with:
# files: "${{ github.event.repository.name }}.fmu"

docs:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
needs: [fmu]
needs: [linux]
runs-on: ubuntu-22.04
steps:
- name: Download artifacts
Expand Down

0 comments on commit fd7193e

Please sign in to comment.