Ci updates #13
Workflow file for this run
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: Test | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
build-fmus: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
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: ['lts', 'pre', '1'] | |
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@v2 | |
with: | |
version: ${{ matrix.julia-version }} | |
- 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 |