Skip to content

OSS-132-native-commmands-lib #1854

OSS-132-native-commmands-lib

OSS-132-native-commmands-lib #1854

Workflow file for this run

name: Scala Build
on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]
paths-ignore:
- 'doc/src/main/hugo/**'
- '.github/workflows/gh-pages.yml'
jobs:
scala-build:
permissions:
contents: read
packages: read
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RIDDLC_PATH: riddlc/native/target/scala-3.4.3/riddlc
COURSIER_REPOSITORIES: central|maven:https://maven.pkg.github.com/ossuminc
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set Up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: temurin
cache: sbt
- name: Configure SBT Credentials
run: |
mkdir -p ~/.sbt/1.0
echo "credentials += Credentials(
\"GitHub Package Registry\",
\"maven.pkg.github.com\",
\"$GITHUB_ACTOR\",
\"$GITHUB_TOKEN\"
)" > ~/.sbt/1.0/github.sbt
- name: Set Up SBT
uses: sbt/setup-sbt@v1
- name: Configure Coursier Credentials
run: |
mkdir -p ~/.config/coursier
echo "realm=GitHub Package Registry
host=maven.pkg.github.com
user=$GITHUB_ACTOR
password=$GITHUB_TOKEN" > ~/.config/coursier/credentials.properties
# Also set specific environment variables for coursier
echo "COURSIER_CREDENTIALS=$HOME/.config/coursier/credentials.properties" >> $GITHUB_ENV
- name: Configure Coursier
run: |
mkdir -p ~/.config/coursier
echo "
repositories:
- central
- maven:https://maven.pkg.github.com/ossuminc/sbt-ossuminc
" > ~/.config/coursier/repositories
- name: Debug SBT Resolution
run: |
sbt -v -Dsbt.log.noformat=true \
-Dsbt.global.base=.sbt \
-Dsbt.boot.directory=.sbt/boot \
-Dsbt.ivy.home=.ivy2 \
-Dcoursier.verbose=true \
plugins
- name: Debug Package Resolution
env:
COURSIER_VERBOSE: true
SBT_VERBOSE: true
run: |
curl -v -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
"https://maven.pkg.github.com/ossuminc/sbt-ossuminc/com/ossuminc/sbt-ossuminc_2.12_1.0/0.20.3/sbt-ossuminc-0.20.3.pom"
sbt -Dsbt.log.level=debug \
-Dsbt.global.base=.sbt \
-Dsbt.boot.directory=.sbt/boot \
-Dsbt.ivy.home=.ivy2 \
"show resolvers"
- name: Check Clang Okayness
run: |
echo CLANG: `which clang`
echo LD64.LLD: `which ld64.lld`
echo LLD: `which lld`
clang --version
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.112.0'
extended: true
- name: Coursier Caching
uses: coursier/cache-action@v6
- name: Test Package Registry Access With Curl
run: |
curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github+json" \
https://api.github.com/orgs/ossuminc/packages?package_type=maven
- name: Configure Coursier
run: |
mkdir -p ~/.config/coursier
echo "credentials.githubusercontent.com.realm=GitHub Package Registry" >> ~/.config/coursier/credentials.properties
echo "credentials.githubusercontent.com.host=maven.pkg.github.com" >> ~/.config/coursier/credentials.properties
echo "credentials.githubusercontent.com.user=$GITHUB_ACTOR" >> ~/.config/coursier/credentials.properties
echo "credentials.githubusercontent.com.password=${{ secrets.GITHUB_TOKEN }}" >> ~/.config/coursier/credentials.properties
- name: Build And Test JVM Versions
run: |
sbt -v clean \
utils/Test/compile \
language/Test/compile \
passes/Test/compile \
diagrams/Test/compile \
commands/Test/compile \
riddlLib/Test/compile \
riddlc/Test/compile \
utils/test \
language/test \
passes/test \
diagrams/test \
commands/test \
riddlLib/test \
riddlc/test
- name: Build And Test Native Versions
run: |
sbt -v \
utilsNative/Test/compile \
languageNative/Test/compile \
passesNative/Test/compile \
diagramsNative/Test/compile \
commandsNative/Test/compile \
riddlLibNative/Test/compile \
riddlcNative/Test/compile \
utilsNative/test \
languageNative/test \
passesNative/test \
diagramsNative/test \
commandsNative/test \
riddlLibNative/compile \
riddlcNative/test
- name: Build And Test JS Versions
run: |
sbt -v \
utilsJS/Test/compile \
languageJS/Test/compile \
passesJS/Test/compile \
diagramsJS/Test/compile \
riddlLibJS/Test/compile \
utilsJS/test \
languageJS/test \
passesJS/test \
diagramsJS/test \
riddlLibJS/test
- name: Package Release Artifacts
run: |
sbt -v \
riddlc/Universal/packageBin \
riddlcNative/nativeLink \
riddlLibJS/fullLinkJS
- name: Publish JVM RIDDL Libs & Test sbt-riddl plugin
env:
RIDDLC_PATH: riddlc/jvm/target/universal/stage/bin/riddlc
run: |
sbt -v \
utils/publishLocal \
language/publishLocal \
passes/publishLocal \
diagrams/publishLocal \
commands/publishLocal \
riddlLib/publishLocal \
riddlc/stage \
sbt-riddl/scripted
- name: Collect Release Artifacts
uses: actions/upload-artifact@v4
with:
name: collect-release-artifacts
path: |
- riddlc/native/target/scala-3.4.3/riddlc
- riddlc/jvm/target/universal/riddlc.zip
- riddlLib/js/target/scala-3.4.3/riddl-lib-opt/main.js
- name: Cleanup Before Caching
shell: bash
run: |
rm -rf "$HOME/.ivy2/local" || true
find $HOME/Library/Caches/Coursier/v1 -name "ivydata-*.properties" -delete || 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