|
11 | 11 | - cron: '0 3 * * *' # every day 03:00 UTC |
12 | 12 | workflow_dispatch: |
13 | 13 | inputs: |
| 14 | + library: |
| 15 | + description: 'Modelica library name' |
| 16 | + required: false |
| 17 | + default: 'Modelica' |
| 18 | + type: string |
14 | 19 | lib_version: |
15 | 20 | description: 'Modelica Standard Library version' |
16 | 21 | required: false |
17 | 22 | default: '4.1.0' |
18 | 23 | type: string |
| 24 | + bm_version: |
| 25 | + description: 'BaseModelica.jl version (branch, tag, or "main")' |
| 26 | + required: false |
| 27 | + default: 'main' |
| 28 | + type: string |
19 | 29 |
|
20 | 30 | concurrency: |
21 | 31 | group: pages |
22 | 32 | cancel-in-progress: false # never abort a Pages deployment mid-flight |
23 | 33 |
|
24 | 34 | permissions: |
25 | 35 | contents: write # needed to push to gh-pages |
| 36 | + pages: write # needed to deploy to GitHub Pages |
| 37 | + id-token: write # needed for OIDC Pages deployment |
26 | 38 |
|
27 | 39 | jobs: |
28 | 40 | test-and-deploy: |
|
31 | 43 | timeout-minutes: 480 |
32 | 44 |
|
33 | 45 | env: |
| 46 | + LIB_NAME: ${{ inputs.library || 'Modelica' }} |
34 | 47 | LIB_VERSION: ${{ inputs.lib_version || '4.1.0' }} |
| 48 | + BM_VERSION_INPUT: ${{ inputs.bm_version || 'main' }} |
35 | 49 |
|
36 | 50 | steps: |
37 | 51 | - name: Checkout source |
|
44 | 58 | packages: | |
45 | 59 | omc |
46 | 60 | libraries: | |
47 | | - 'Modelica ${{ env.LIB_VERSION }}' |
| 61 | + '${{ env.LIB_NAME }} ${{ env.LIB_VERSION }}' |
48 | 62 |
|
49 | 63 | - name: Set up Julia |
50 | 64 | uses: julia-actions/setup-julia@v2 |
|
55 | 69 | - name: Restore Julia package cache |
56 | 70 | uses: julia-actions/cache@v2 |
57 | 71 |
|
| 72 | + - name: Pin BaseModelica.jl version |
| 73 | + if: env.BM_VERSION_INPUT != 'main' |
| 74 | + run: julia --project=. -e 'using Pkg; Pkg.add(PackageSpec(name="BaseModelica", version=ENV["BM_VERSION_INPUT"]))' |
| 75 | + |
58 | 76 | - name: Build package |
59 | 77 | uses: julia-actions/julia-buildpkg@v1 |
60 | 78 |
|
|
84 | 102 | julia --project=. -e ' |
85 | 103 | using BaseModelicaLibraryTesting |
86 | 104 | main( |
87 | | - library = "Modelica", |
| 105 | + library = ENV["LIB_NAME"], |
88 | 106 | version = ENV["LIB_VERSION"], |
89 | | - results_root = "results/$(ENV["BM_VERSION"])/Modelica/$(ENV["LIB_VERSION"])", |
| 107 | + results_root = "results/$(ENV["BM_VERSION"])/$(ENV["LIB_NAME"])/$(ENV["LIB_VERSION"])", |
90 | 108 | ref_root = "MAP-LIB_ReferenceResults", |
91 | 109 | ) |
92 | 110 | ' |
@@ -125,5 +143,13 @@ jobs: |
125 | 143 | git config user.email "github-actions[bot]@users.noreply.github.com" |
126 | 144 | git add -A |
127 | 145 | git diff --cached --quiet && { echo "Nothing to commit."; exit 0; } |
128 | | - git commit -m "results: ${BM_VERSION}/Modelica/${LIB_VERSION} [$(date -u '+%Y-%m-%d')]" |
| 146 | + git commit -m "results: ${BM_VERSION}/${LIB_NAME}/${LIB_VERSION} [$(date -u '+%Y-%m-%d')]" |
129 | 147 | git push origin HEAD:gh-pages |
| 148 | +
|
| 149 | + - name: Upload Pages artifact |
| 150 | + uses: actions/upload-pages-artifact@v4 |
| 151 | + with: |
| 152 | + path: site/ |
| 153 | + |
| 154 | + - name: Deploy to GitHub Pages |
| 155 | + uses: actions/deploy-pages@v4 |
0 commit comments