-
-
Notifications
You must be signed in to change notification settings - Fork 1
218 lines (190 loc) · 6.46 KB
/
scala.yml
File metadata and controls
218 lines (190 loc) · 6.46 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
name: Scala Build
on:
workflow_dispatch:
push:
branches: [ main, development ]
pull_request:
branches: [ main, development ]
paths-ignore:
- 'doc/src/main/hugo/**'
- '.github/workflows/gh-pages.yml'
jobs:
scala-build:
timeout-minutes: 60
permissions:
contents: read
packages: read
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RIDDLC_PATH: riddlc/native/target/scala-3.3.7/riddlc
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform: [JVM, Native, JS]
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set Up JDK 25
uses: actions/setup-java@v4
with:
java-version: '25'
distribution: temurin
cache: sbt
- name: Set Up SBT
uses: sbt/setup-sbt@7e33f738678e47369c83dcb4b1d9c65d66eb3cdd # v1
- name: Coursier Caching
uses: coursier/cache-action@2addd381bd2c931f42d4b734b9d0c9b73aac16fb # v6
- name: Configure sbt GitHub Packages credentials
run: |
mkdir -p ~/.sbt/1.0
cat > ~/.sbt/1.0/github.sbt << 'EOF'
credentials += Credentials(
"GitHub Package Registry",
"maven.pkg.github.com",
"x-access-token",
sys.env.getOrElse("GITHUB_TOKEN", "")
)
EOF
- name: Cache SBT Build Outputs
uses: actions/cache@v4
with:
path: |
**/target/scala-3.3.7
!**/target/scala-3.3.7/src_managed
!**/target/scala-3.3.7/resource_managed
key: ${{ runner.os }}-sbt-build-${{ matrix.platform }}-${{ hashFiles('**/*.sbt', 'project/**') }}
restore-keys: |
${{ runner.os }}-sbt-build-${{ matrix.platform }}-
${{ runner.os }}-sbt-build-
- name: Install LLVM and Clang (Native only)
if: matrix.platform == 'Native'
run: |
sudo apt-get update && sudo apt-get install -y clang llvm
echo CLANG: `which clang`
echo LD64.LLD: `which ld64.lld`
echo LLD: `which lld`
clang --version
- name: Install curl dev dependencies (Native only)
if: matrix.platform == 'Native'
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev libidn2-dev
- name: Build And Test ${{ matrix.platform }} Versions
run: |
sbt clean c${{ matrix.platform }} t${{ matrix.platform }}
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@12fa20e14d449d310778f2d0af1e3b2f57dde2a7 # v2
if: always()
continue-on-error: true # Prevent workflow failure from permissions issues on PRs
with:
files: |
**/target/test-reports/*.xml
- name: Publish JVM RIDDL Libs & Test sbt-riddl plugin
if: matrix.platform == 'JVM'
env:
RIDDLC_PATH: riddlc/jvm/target/universal/stage/bin/riddlc
run: |
sbt \
utils/publishLocal \
language/publishLocal \
passes/publishLocal \
commands/publishLocal \
riddlLib/publishLocal \
riddlc/stage \
sbt-riddl/scripted
- name: Package JVM Release Artifacts
if: matrix.platform == 'JVM'
run: |
sbt "set every Compile/doc/sources := Seq.empty" "riddlc/Universal/packageBin" "riddlLib/Universal/packageBin"
- name: Package Native Release Artifacts
if: matrix.platform == 'Native'
run: |
sbt riddlcNative/nativeLink riddlLibNative/nativeLink
- name: Package JS Release Artifacts
if: matrix.platform == 'JS'
run: |
sbt riddlLibJS/fullLinkJS
- name: Collect Release Artifacts (JVM)
if: matrix.platform == 'JVM'
uses: actions/upload-artifact@v4
with:
name: collect-release-artifacts-jvm
retention-days: 30
path: |
riddlc/jvm/target/universal/riddlc.zip
riddlLib/jvm/target/universal/riddlLib.zip
- name: Collect Release Artifacts (Native)
if: matrix.platform == 'Native'
uses: actions/upload-artifact@v4
with:
name: collect-release-artifacts-native
retention-days: 30
path: |
riddlc/native/target/scala-3.3.7/riddlc
riddlLib/native/target/scala-3.3.7/libriddl-lib.a
- name: Collect Release Artifacts (JS)
if: matrix.platform == 'JS'
uses: actions/upload-artifact@v4
with:
name: collect-release-artifacts-js
retention-days: 30
path: |
riddlLib/js/target/scala-3.3.7/riddl-lib-opt/main.js
- name: Cleanup Before Caching
shell: bash
run: |
rm -rf "$HOME/.ivy2/local" || true
find $HOME/.ivy2/cache -name "ivydata-*.properties" -delete || true
find $HOME/.cache/coursier/v1 -name "ivydata-*.properties" -delete || true
find $HOME/.sbt -name "*.lock" -delete || true
ebnf-grammar-validation:
timeout-minutes: 5
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set Up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Dependencies
run: |
pip install -r language/jvm/src/test/python/requirements.txt
- name: Validate EBNF Grammar with TatSu (internal test files)
run: |
cd language/jvm/src/test/python
python ebnf_tatsu_validator.py --verbose
- name: Checkout riddl-examples
uses: actions/checkout@v4
with:
repository: ossuminc/riddl-examples
path: riddl-examples
- name: Validate EBNF Grammar against riddl-examples
run: |
cd language/jvm/src/test/python
python validate_external_riddl.py --repo ${{ github.workspace }}/riddl-examples
dependency-check:
timeout-minutes: 15
permissions:
contents: read
security-events: write
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Run Dependency Check
uses: dependency-check/Dependency-Check_Action@1e54355a8b4c8abaa8cc7d0b70aa655a3bb15a6c # main
with:
project: 'riddl'
path: '.'
format: 'SARIF'
args: >
--enableRetired
--enableExperimental
- name: Upload Dependency Check Results
uses: github/codeql-action/upload-sarif@a4fda0891d53e117609b7ddb3570638c2c6d7c89 # v3
with:
sarif_file: reports/dependency-check-report.sarif