Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 37 additions & 13 deletions .github/workflows/msl-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,30 @@ on:
- cron: '0 3 * * *' # every day 03:00 UTC
workflow_dispatch:
inputs:
library:
description: 'Modelica library name'
required: false
default: 'Modelica'
type: string
lib_version:
description: 'Modelica Standard Library version'
required: false
default: '4.1.0'
type: string
bm_version:
description: 'BaseModelica.jl version (branch, tag, or "main")'
required: false
default: 'main'
type: string

concurrency:
group: pages
cancel-in-progress: false # never abort a Pages deployment mid-flight

permissions:
contents: write # needed to push to gh-pages
pages: write # needed to deploy to GitHub Pages
id-token: write # needed for OIDC Pages deployment

jobs:
test-and-deploy:
Expand All @@ -31,7 +43,9 @@ jobs:
timeout-minutes: 480

env:
LIB_NAME: ${{ inputs.library || 'Modelica' }}
LIB_VERSION: ${{ inputs.lib_version || '4.1.0' }}
BM_VERSION_INPUT: ${{ inputs.bm_version || 'main' }}

steps:
- name: Checkout source
Expand All @@ -44,7 +58,7 @@ jobs:
packages: |
omc
libraries: |
'Modelica ${{ env.LIB_VERSION }}'
'${{ env.LIB_NAME }} ${{ env.LIB_VERSION }}'

- name: Set up Julia
uses: julia-actions/setup-julia@v2
Expand All @@ -56,7 +70,17 @@ jobs:
uses: julia-actions/cache@v2

- name: Build package
uses: julia-actions/julia-buildpkg@v1
run: |
julia --project=. -e '
using Pkg
bm_ver = get(ENV, "BM_VERSION_INPUT", "main")
if bm_ver != "main"
Pkg.add(name="BaseModelica", version=bm_ver)
else
Pkg.add(name="BaseModelica", rev=bm_ver)
end
Pkg.instantiate()
'

# ── Resolve versions ──────────────────────────────────────────────────────
- name: Resolve BaseModelica.jl version
Expand Down Expand Up @@ -84,21 +108,13 @@ jobs:
julia --project=. -e '
using BaseModelicaLibraryTesting
main(
library = "Modelica",
library = ENV["LIB_NAME"],
version = ENV["LIB_VERSION"],
results_root = "results/$(ENV["BM_VERSION"])/Modelica/$(ENV["LIB_VERSION"])",
results_root = "results/$(ENV["BM_VERSION"])/$(ENV["LIB_NAME"])/$(ENV["LIB_VERSION"])",
ref_root = "MAP-LIB_ReferenceResults",
)
'

- name: Upload test results
uses: actions/upload-artifact@v6
with:
name: sanity-results-${{ matrix.os }}
path: results/
if-no-files-found: error


# ── Deploy to gh-pages ────────────────────────────────────────────────────
- name: Prepare gh-pages worktree
run: |
Expand All @@ -125,5 +141,13 @@ jobs:
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git diff --cached --quiet && { echo "Nothing to commit."; exit 0; }
git commit -m "results: ${BM_VERSION}/Modelica/${LIB_VERSION} [$(date -u '+%Y-%m-%d')]"
git commit -m "results: ${BM_VERSION}/${LIB_NAME}/${LIB_VERSION} [$(date -u '+%Y-%m-%d')]"
git push origin HEAD:gh-pages

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v4
with:
path: site/

- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4