Repository navigation
144 lines (131 loc) · 5.4 KB
/
Copy pathci.yml
File metadata and controls
144 lines (131 loc) · 5.4 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: CI
on:
pull_request:
push:
branches:
- master
- "1.13"
tags: '*'
workflow_call:
workflow_dispatch:
# Cancel superseded runs of the same ref, but keep master runs queued.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
env:
# Pinning JULIA_PROJECT at job level lets julia-actions/cache,
# julia-actions/julia-buildpkg and the inline julia invocations all key
# off the same Project.toml (OMFrontend.jl/Project.toml lives in a
# subdirectory of the workspace, so without this the cache action does
# not find it and the depot cache key falls back to a workflow-wide
# default).
JULIA_PROJECT: OMFrontend.jl
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
# Listing every combination explicitly keeps the matrix predictable.
include:
# Coverage is only collected/uploaded on one runner.
- os: ubuntu-latest
arch: x64
version: '1.13'
coverage: true
- os: windows-latest
arch: x64
version: '1.13'
- os: macos-latest
arch: aarch64
version: '1.13'
steps:
- name: Checkout OMFrontend.jl
uses: actions/checkout@v4
with:
path: OMFrontend.jl
# Project.toml [sources] (and the transitive [sources] inside DoubleEnded
# / ListUtil) points at sibling working copies in ../<name>.jl. We lay
# the siblings out alongside the main checkout so Pkg.resolve finds them.
# The shared action checks the siblings out at the branch that matches
# this change (the PR branch if the sibling has it, else the PR base
# branch, e.g. 1.13, else master) from the OpenModelica repositories.
- name: Checkout sibling OM*.jl packages
uses: JKRT/OM.jl/.github/actions/checkout-siblings@master
with:
packages: Absyn ArrayUtil DAE DoubleEnded ImmutableList ListUtil MetaModelica OMParser OMRuntimeExternalC SCode
- name: Setup Julia ${{ matrix.version }}-${{ matrix.arch }}
uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v2
with:
# Explicit cache namespace so this workflow does not collide with
# any future workflow in the repo, and so PR runs share cache with
# one another rather than with the nightly job.
cache-name: omfrontend-ci
cache-registries: 'true'
include-matrix: 'true'
- name: Build
# bash on every runner so we do not have to escape quotes for PowerShell.
# Compiled modules are enabled (Julia default) so CI exercises the
# PrecompileTools @compile_workload that ships with OMFrontend; this
# mirrors what end users hit on first `using OMFrontend`.
# We Pkg.develop every sibling because Project.toml [sources] only
# applies to direct deps; DoubleEnded is a transitive dep (via ListUtil)
# and otherwise falls back to the registry version, which has [compat]
# incompatible with the local ImmutableList 0.3.0.
shell: bash
working-directory: OMFrontend.jl
run: |
julia --color=yes --project -e '
import Pkg
Pkg.Registry.add("General")
Pkg.Registry.add(Pkg.RegistrySpec(url = "https://github.com/OpenModelica/OpenModelicaRegistry.git"))
siblings = [
"../Absyn.jl",
"../ArrayUtil.jl",
"../DAE.jl",
"../DoubleEnded.jl",
"../ImmutableList.jl",
"../ListUtil.jl",
"../MetaModelica.jl",
"../OMParser.jl",
"../OMRuntimeExternalC.jl",
"../SCode.jl",
]
Pkg.develop([Pkg.PackageSpec(path = p) for p in siblings])
Pkg.build(; verbose = true)
Pkg.resolve()
'
- name: Test
# Drive runtests.jl directly (rather than via Pkg.test) so we reuse
# the precompile cache from the Build step. Pkg.test would create a
# sandboxed test environment with a different manifest hash and
# re-precompile the entire dep graph from scratch -- including the
# OMFrontend @compile_workload, which loads MSL_4_0_0 and is the
# most expensive part of the build. Test is already in [deps] so
# no [extras] merging is needed.
# --code-coverage=user emits .cov files next to user source for the
# downstream julia-processcoverage step. Only enabled on the coverage
# runner; the others run tests without the coverage overhead.
shell: bash
working-directory: OMFrontend.jl
run: |
julia --color=yes ${{ matrix.coverage && '--code-coverage=user' || '' }} --project=. -e '
include("test/runtests.jl")
'
- uses: julia-actions/julia-processcoverage@v1
if: matrix.coverage
with:
directories: OMFrontend.jl/src
- name: Upload coverage to Codecov
if: matrix.coverage
uses: codecov/codecov-action@v4
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false