-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (109 loc) · 4.44 KB
/
msl-test.yml
File metadata and controls
129 lines (109 loc) · 4.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: MSL Test & GitHub Pages
# Run the full Modelica Standard Library pipeline and publish results to
# GitHub Pages at results/<bm_version>/Modelica/<lib_version>/
#
# Prerequisites (one-time repo setup):
# Settings → Pages → Source: Deploy from a branch → Branch: gh-pages / (root)
on:
schedule:
- cron: '0 3 * * *' # every day 03:00 UTC
workflow_dispatch:
inputs:
lib_version:
description: 'Modelica Standard Library version'
required: false
default: '4.1.0'
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
jobs:
test-and-deploy:
name: Test MSL & Deploy Pages
runs-on: ubuntu-latest
timeout-minutes: 480
env:
LIB_VERSION: ${{ inputs.lib_version || '4.1.0' }}
steps:
- name: Checkout source
uses: actions/checkout@v6
- name: Set up OpenModelica (nightly)
uses: OpenModelica/setup-openmodelica@v1.0
with:
version: nightly
packages: |
omc
libraries: |
'Modelica ${{ env.LIB_VERSION }}'
- name: Set up Julia
uses: julia-actions/setup-julia@v2
with:
version: '1'
arch: x64
- name: Restore Julia package cache
uses: julia-actions/cache@v2
- name: Build package
uses: julia-actions/julia-buildpkg@v1
# ── Resolve versions ──────────────────────────────────────────────────────
- name: Resolve BaseModelica.jl version
id: versions
run: |
julia --project=. -e '
import BaseModelica
println("bm_version=" * string(pkgversion(BaseModelica)))
' >> "$GITHUB_OUTPUT"
# ── Reference results ─────────────────────────────────────────────────────
- name: Checkout MAP-LIB reference results
uses: actions/checkout@v6
with:
repository: modelica/MAP-LIB_ReferenceResults
ref: v${{ env.LIB_VERSION }}
path: MAP-LIB_ReferenceResults
fetch-depth: 1
# ── Run the pipeline ──────────────────────────────────────────────────────
- name: Run MSL pipeline
env:
BM_VERSION: ${{ steps.versions.outputs.bm_version }}
run: |
julia --project=. -e '
using BaseModelicaLibraryTesting
main(
library = "Modelica",
version = ENV["LIB_VERSION"],
results_root = "results/$(ENV["BM_VERSION"])/Modelica/$(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: |
git fetch origin gh-pages 2>/dev/null || true
if git show-ref --verify refs/remotes/origin/gh-pages 2>/dev/null; then
git worktree add site origin/gh-pages
else
# First ever run: create an orphan branch
git worktree add --orphan -b gh-pages site
fi
- name: Copy new results into gh-pages tree
run: rsync -a results/ site/results/
- name: Generate landing page
run: python3 .github/scripts/gen_landing_page.py site
- name: Commit and push to gh-pages
env:
BM_VERSION: ${{ steps.versions.outputs.bm_version }}
run: |
cd site
git config user.name "github-actions[bot]"
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 push origin HEAD:gh-pages