Skip to content

Merge pull request #8 from CasBex/fmu_compatibility_docs #6

Merge pull request #8 from CasBex/fmu_compatibility_docs

Merge pull request #8 from CasBex/fmu_compatibility_docs #6

Workflow file for this run

name: Test
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build-fmus:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
julia-version: ['1.6']
julia-arch: [x64]
os: [ubuntu-latest]
experimental: [false]
steps:
- name: "get omc"
run:
sudo apt update
sudo apt install ca-certificates curl gnupg
sudo curl -fsSL http://build.openmodelica.org/apt/openmodelica.asc | sudo gpg --dearmor -o /usr/share/keyrings/openmodelica-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/openmodelica-keyring.gpg] https://build.openmodelica.org/apt $(cat /etc/os-release | grep "\(UBUNTU\\|DEBIAN\\|VERSION\)_CODENAME" | sort | cut -d= -f 2 | head -1) stable" | sudo tee /etc/apt/sources.list.d/openmodelica.list
sudo apt update
sudo apt install -y --no-install-recommends omc
- name: "get Modelica libs"
run:
git config --global advice.detachedHead false
git clone https://github.com/lbl-srg/modelica-buildings ~/.openmodelica/libraries/modelica-buildings --branch v9.1.1 --depth 1
git clone https://github.com/open-ideas/IDEAS ~/.openmodelica/libraries/IDEASlib --branch v3.0 --depth 1
git clone https://gitlab.kuleuven.be/positive-energy-districts/moped ~/.openmodelica/libraries/moped
git clone https://github.com/modelica/ModelicaStandardLibrary ~/.openmodelica/libraries/ModelicaStandardLibrary --branch v4.0.0 --single-branch
mv ~/.openmodelica/libraries/modelica-buildings/Buildings ~/.openmodelica/libraries/
mv ~/.openmodelica/libraries/IDEASlib/IDEAS ~/.openmodelica/libraries/
mv ~/.openmodelica/libraries/moped/MoPED ~/.openmodelica/libraries/
mv ~/.openmodelica/libraries/ModelicaStandardLibrary/Modelica ~/.openmodelica/libraries/
- name: Check out repository
uses: actions/checkout@v4
- name: Build step
run:
cd deps
mkdir build
cp src/* build -r
cd build
for d in */; do
cd $d;
omc buildFMU.mos;
cd ..;
done;
cd ..
mkdir fmu
find build -iname '*.fmu' -exec mv {} fmu \;
tar -czf fmu.tar.gz fmu
cd ..
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: fmus
path: deps/fmu.tar.gz
test:
needs:
- build-fmus
runs-on: ${{ matrix.os }}
env:
JULIA_NUM_THREADS: $(nproc)
strategy:
fail-fast: false
matrix:
julia-version: ['1.6']
julia-arch: [x64]
os: [ubuntu-latest]
experimental: [false]
steps:
# Checks-out your repository
- name: Check out repository
uses: actions/checkout@v4
- name: "Set up Julia"
uses: julia-actions/setup-julia@v1
with:
version: '1.6'
- uses: actions/cache@v3
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- name: "Download FMUs"
uses: actions/download-artifact@v3
with:
name: fmus
path: deps
- name: "Extract FMUs"
run: tar -xzf deps/fmu.tar.gz -C deps
# # Run the tests
- name: "Run tests"
uses: julia-actions/julia-runtest@v1
# Preprocess Coverage
- name: "Preprocess Coverage"
uses: julia-actions/julia-processcoverage@v1
# Run codecov
- name: "Run CodeCov"
uses: codecov/codecov-action@v3
with:
file: lcov.info