Skip to content

Daily ETHOS.PeNALPS Tests #60

Daily ETHOS.PeNALPS Tests

Daily ETHOS.PeNALPS Tests #60

Workflow file for this run

name: Daily ETHOS.PeNALPS Tests
on:
workflow_dispatch:
inputs:
tags:
description: 'Manual run'
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
# Allows to trigger the workflow manually
schedule:
# * is a special character in YAML so you have to quote this string
# Some Examples for cron syntax https://crontab.guru/examples.html
# Schedules job at any point after 12 pm
- cron: '0 0 * * *'
# Weekly after sunday
# - cron: 0 0 * * 0
jobs:
TestPeNALPSCondaForge:
name: Ex1 (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest","ubuntu-20.04", "macos-latest","macos-13","macos-12", "windows-latest","windows-2019"]
steps:
- uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
channels: conda-forge
activate-environment: test_env
- name: Install Penalps
shell: pwsh
run: |
ls
echo "LS Done"
mamba install -n test_env ethos_penalps pytest pytest-xdist
echo "Installation done"
conda list -n test_env -e
- name: get_penalps_version
shell: pwsh
id: penalps-version
# ethos_penalps might be displayed as ethos-penalps which requires adaption of the following code
run: |
$PENALPS_STRING = conda list -n test_env ethos_penalps -e | Out-String
echo "The penalps string is"
echo $PENALPS_STRING
echo "Start to extract the version"
$PENALPS_VERSION = [regex]::Match($PENALPS_STRING, 'ethos_penalps=(\d+\.\d+\.\d+)=').Groups[1].Value
"PENALPS_VERSION=$PENALPS_VERSION" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
echo "Print the extracted version"
echo $PENALPS_VERSION
echo "Terminate get penalps version"
- name: Checkout to penalps repository
uses: actions/checkout@v4
with:
repository: FZJ-IEK3-VSA/ETHOS_PeNALPS
path: './ETHOS_PENALPS'
ref: ${{ steps.penalps-version.outputs.PENALPS_VERSION }}
fetch-depth: 0
fetch-tags: true
- name: Run tests
shell: pwsh
run: |
echo "The checkout ethos_penalps version was:"
echo ${{ steps.penalps-version.outputs.PENALPS_VERSION }}
echo "start pytest"
conda run -n test_env pytest
echo "Pytest done"
TestPeNALPSDevLocal:
name: Ex1 (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest","ubuntu-20.04", "macos-latest","macos-13","macos-12", "windows-latest","windows-2019"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: FZJ-IEK3-VSA/ETHOS_PeNALPS
path: './ETHOS_PENALPS'
ref: main
- uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
channels: conda-forge
activate-environment: test_env
- name: Run tests
shell: pwsh
run: |
ls
echo "LS Done"
cd ETHOS_PENALPS
mamba env create --name penalps_env --yes --file environment.yml
conda run --name penalps_env pip install . --no-deps
echo "Installation done"
conda list --name penalps_env
echo "libaries printed"
echo "start pytest"
conda run --name penalps_env pytest
echo "Pytest done"
echo "run examples"
- name: Run examples
shell: pwsh
run: |
ls
cd ETHOS_PENALPS
cd examples
cd tutorial
conda run --name penalps_env python _1_cooking_example.py
conda run --name penalps_env python _2_cooking_example_more_states.py
conda run --name penalps_env python _3_add_more_cooker_for_parallel_operation.py
conda run --name penalps_env python _4_cooking_and_mixer_exclusive_example.py
cd _5_connect_four_process_steps
conda run --name penalps_env python simulation_starter.py
cd ..
cd ..
cd toffee_production
conda run --name penalps_env python simulation_starter.py
cd ..
cd basic_examples
conda run --name penalps_env python batch_to_batch_1_node_example.py
cd ..
cd b_pillar_manufacturing
conda run --name penalps_env python simulation_starter.py
echo "Running examples terminated"
#"PENALPS_VERSION=$PENALPS_VERSION" >> $GITHUB_OUTPUT