Skip to content

Update URN rules

Update URN rules #608

name: Check New Pull Request
on:
pull_request:
branches:
- main
paths-ignore:
- 'documentation/decisions/**'
jobs:
build-and-test:
name: ${{ matrix.os }} build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [windows-latest, ubuntu-20.04, macos-13]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check code style
if: matrix.os == 'ubuntu-20.04'
uses: dbelyaev/action-checkstyle@e89baf0f8b488b946345b7de8e975be1e3606387 # v1.5.6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
checkstyle_config: esmf-checkstyle.xml
level: warning
fail_on_error: true
- name: Setup JDK
uses: graalvm/setup-graalvm@2f25c0caae5b220866f732832d5e3e29ff493338 # v1.2.1
with:
java-version: '17.0.10'
distribution: 'graalvm'
components: 'native-image,js'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Configure Pagefile (Windows)
if: matrix.os == 'windows-latest'
# Fix for "LINK : fatal error LNK1171: unable to load mspdbcore.dll (error code: 1455)":
# This seems to be caused by running out of memory; increasing page file
# size suggested here:
# https://github.com/actions/virtual-environments/issues/3420#issuecomment-861342418
uses: al-cheb/configure-pagefile-action@86589fd789a4de3e62ba628dda2cb10027b66d67 # v1.3
with:
minimum-size: 32GB
maximum-size: 32GB
disk-root: "C:"
- name: Set Swap Space (Linux)
if: matrix.os == 'ubuntu-20.04'
uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c # master
with:
swap-size-gb: 12
- name: Build and run tests
run: |
java --version
export MAVEN_OPTS="-Xmx4096m"
export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"
mvn -B -pl '!org.eclipse.esmf:samm-cli' clean install -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
cd tools/samm-cli
unset JAVA_TOOL_OPTIONS
mvn -B clean verify -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
shell: bash
- name: Build native image
if: matrix.os != 'macos-13'
run: |
export MAVEN_OPTS="-Xmx4096m"
cd tools/samm-cli
mvn -B package -Pnative -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
shell: bash
- name: Build native image (Mac)
if: matrix.os == 'macos-13'
run: |
bundle="samm-bundle-DEV-SNAPSHOT-$(date +%s)"
mkdir ${bundle}
curl -Lo jre.tar.gz https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.3%2B9/OpenJDK21U-jre_x64_mac_hotspot_21.0.3_9.tar.gz
tar -xvf jre.tar.gz
cp -r ./jdk-21.0.3+9-jre/Contents/Home ./${bundle}/jre
cp tools/samm-cli/target/samm-cli-DEV-SNAPSHOT.jar ./${bundle}/
cat <<EOF > ./${bundle}/run.sh
#!/usr/bin/env bash
HERE=\${BASH_SOURCE%/*}
"\$HERE/jre/bin/java" -jar "\$HERE/samm-cli-DEV-SNAPSHOT.jar" "\$@"
EOF
chmod +x ./${bundle}/run.sh
curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/macos-x64.warp-packer
chmod +x warp-packer
./warp-packer --arch macos-x64 --input_dir ${bundle} --exec run.sh --output samm
chmod +x samm
shell: bash
- name: Create convenience batch file
if: matrix.os == 'windows-latest'
run: |
echo "start cmd /k samm.exe help" > tools/samm-cli/target/start-samm-cli.bat
shell: bash
- name: Switch to Temurin JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
overwrite-settings: false
- name: Test executable jar on Temurin
if: matrix.os == 'ubuntu-20.04'
run: |
cd tools/samm-cli
mvn -B -Denforcer.skip -Dskip.maven.surefire failsafe:integration-test -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
- name: Upload executable jar
# We only need one OS job to upload the jar
if: matrix.os == 'ubuntu-20.04'
uses: actions/upload-artifact@v4
with:
name: samm-cli-jar
path: tools/samm-cli/target/samm-cli-*.jar
- name: Upload binary (Windows)
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: samm-cli-binary-${{ matrix.os }}
path: |
tools/samm-cli/target/samm.exe
tools/samm-cli/target/*.dll
tools/samm-cli/target/*.bat
tools/samm-cli/target/lib/
- name: Upload binary (Linux)
if: matrix.os == 'ubuntu-20.04'
uses: actions/upload-artifact@v4
with:
name: samm-cli-binary-${{ matrix.os }}
path: |
tools/samm-cli/target/samm
tools/samm-cli/target/*.so
- name: Upload binary (Mac)
if: matrix.os == 'macos-13'
uses: actions/upload-artifact@v4
with:
name: samm-cli-binary-${{ matrix.os }}
path: |
samm