Skip to content

[1.3]: three of four links fixed; the fourth is a fetch bug, not a stub #2331

[1.3]: three of four links fixed; the fourth is a fetch bug, not a stub

[1.3]: three of four links fixed; the fourth is a fetch bug, not a stub #2331

Workflow file for this run

name: Scala Build
on:
workflow_dispatch:
push:
# `release/*` included so a release branch gets CI before it is tagged. The
# 2.0 branch ran for months on local runs alone, because it matched nothing
# here and every CI run on it had to be dispatched by hand.
branches: [ main, development, 'release/*' ]
pull_request:
branches: [ main, development, 'release/*' ]
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: target/out/native0.5/scala-3.9.0-RC4/riddlc/riddlc
# The corpus conforming to this branch lives on riddl-models `release/2`;
# its `main` still holds the 1.x models. Without this the round-trip test
# downloads `main` and fails against the 2.0 grammar — while local runs
# pass, because they use the developer's own checkout. REMOVE this line
# when riddl-models merges to `main` at 2.0.0 final.
RIDDL_MODELS_BRANCH: release/2
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform: [JVM, Native, JS]
steps:
- name: Checkout Code
uses: actions/checkout@v6
with:
fetch-depth: 0 # full history + tags so sbt-dynver can `git describe`
fetch-tags: true
- name: Set Up JDK 25
uses: actions/setup-java@v5
with:
java-version: '25'
distribution: temurin
cache: sbt
- name: Set Up SBT
uses: sbt/setup-sbt@v1
- name: Coursier Caching
uses: coursier/cache-action@v7
- name: Configure sbt GitHub Packages credentials
run: |
mkdir -p ~/.sbt/2
cat > ~/.sbt/2/github.sbt << 'EOF'
credentials += Credentials(
"GitHub Package Registry",
"maven.pkg.github.com",
"x-access-token",
sys.env.getOrElse("GITHUB_TOKEN", "")
)
EOF
# NO target/out CACHE. sbt 2's build outputs are NOT safely portable between runs:
# restoring them left sbt believing the meta-build was already built, so
# project/Dependencies.scala never contributed its symbols and build.sbt collapsed with
# dozens of "Not found: V" / "Not found: Dep" plus an Append ambiguity on a line nobody
# had touched. The evidence was unambiguous once the runs were lined up: EVERY cold build
# passed and EVERY build that restored this cache failed, including #2192 and #2193, which
# restored the cache saved by the SUCCESSFUL #2191 and failed anyway. Dropping restore-keys
# first did not fix it -- that only made one run cold by accident.
#
# Dependency downloads, which are the expensive part, are still cached by the Coursier and
# ivy2 steps. What is given up is incremental recompilation between CI runs, which was
# never trustworthy here anyway.
- 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: target/out/jvm/scala-3.9.0-RC4/riddlc/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 "; 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@v6
with:
name: collect-release-artifacts-jvm
retention-days: 30
path: |
target/out/jvm/scala-3.9.0-RC4/riddlc/universal/*.zip
target/out/jvm/scala-3.9.0-RC4/riddl-lib/universal/*.zip
- name: Collect Release Artifacts (Native)
if: matrix.platform == 'Native'
uses: actions/upload-artifact@v6
with:
name: collect-release-artifacts-native
retention-days: 30
path: |
target/out/native0.5/scala-3.9.0-RC4/riddlc/riddlc
target/out/native0.5/scala-3.9.0-RC4/riddl-lib/libriddl-lib.a
- name: Collect Release Artifacts (JS)
if: matrix.platform == 'JS'
uses: actions/upload-artifact@v6
with:
name: collect-release-artifacts-js
retention-days: 30
path: |
target/out/sjs1/scala-3.9.0-RC4/riddl-lib/riddl-lib-opt/main.js
riddlLib/js/types/index.d.ts
- 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@v6
- name: Set Up Python
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Install Dependencies
run: |
pip install -r language/src/test/scalajvm/python/requirements.txt
- name: Validate EBNF Grammar with TatSu (internal test files)
run: |
cd language/src/test/scalajvm/python
python ebnf_tatsu_validator.py --verbose
- name: Checkout riddl-examples
uses: actions/checkout@v6
with:
repository: ossuminc/riddl-examples
path: riddl-examples
- name: Validate EBNF Grammar against riddl-examples
run: |
cd language/src/test/scalajvm/python
python validate_external_riddl.py --repo ${{ github.workspace }}/riddl-examples
# riddl-models is the LARGER corpus and was validated only by hand until now. It is a
# different check from RiddlModelsRoundTripTest: that exercises the fastparse parser and
# BAST round-trip, while this checks the DOCUMENTED EBNF grammar accepts the same inputs.
# If the two ever diverge the round-trip test stays green while the published grammar is
# wrong, which is the whole point of the parser/EBNF synchronisation rule.
#
# Pinned to release/2 for the same reason RIDDL_MODELS_BRANCH is: riddl-models `main`
# still holds the 1.x corpus. Drop the ref when it merges at 2.0.0 final.
- name: Checkout riddl-models
uses: actions/checkout@v6
with:
repository: ossuminc/riddl-models
ref: release/2
path: riddl-models
- name: Validate EBNF Grammar against riddl-models
run: |
cd language/src/test/scalajvm/python
python validate_external_riddl.py --repo ${{ github.workspace }}/riddl-models
- name: Verify GBNF is up-to-date
run: |
cd language/src/test/scalajvm/python
python ebnf_to_gbnf.py --check
- name: Validate GBNF Grammar
run: |
cd language/src/test/scalajvm/python
python gbnf_validator.py --skip-freshness
dependency-check:
timeout-minutes: 15
permissions:
contents: read
security-events: write
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v6
- 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@v4
with:
sarif_file: reports/dependency-check-report.sarif