Skip to content

Specify namespace in URN structure #321

Specify namespace in URN structure

Specify namespace in URN structure #321

name: Check Pull Request
on:
pull_request:
branches:
- main
jobs:
build-test:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- id: changed_files
name: Get changed files
uses: jitterbit/get-changed-files@v1
# Determine whether the PR makes _only_ changes to the markdown files in
# documentation/decisions: If this is the case, a full build is not
# necessary. It will set the ONLY_MD environment variable to 'true' if
# only such .md files where changed and to 'false' if something else was
# changed (and a full build should run).
#
# Note that it is currently impossible to return early from an actions job
# with a successful status, which is why the repeated 'if's in the
# subsequent steps are necessary: https://github.com/actions/runner/issues/662
- id: only_md_changes
name: Check for .md changes
run: |
for changed_file in ${{ steps.changed_files.outputs.all }}; do
if [[ ! "$changed_file" =~ "documentation/decisions/" ]]; then
echo "ONLY_MD=false" >> "$GITHUB_ENV"
echo "Encountered $changed_file, build is necessary"
exit 0
fi
done
echo "ONLY_MD=true" >> "$GITHUB_ENV"
- name: Set up JDK 11
uses: actions/setup-java@v3
if: env.ONLY_MD != 'true'
with:
distribution: 'adopt'
java-version: '11'
- name: Cache Maven packages
uses: actions/cache@v3
if: env.ONLY_MD != 'true'
with:
path: ~/.m2/repository
key: maven-${{ hashFiles('**/pom.xml') }}
- name: Cache node and node_modules
uses: actions/cache@v3
if: env.ONLY_MD != 'true'
with:
path: |
documentation/node
documentation/node_modules
key: node-${{ hashFiles('documentation/package-lock.json') }}
- name: Build
if: env.ONLY_MD != 'true'
run: |
./mvnw -B generate-resources -pl documentation -Pantora
./mvnw -B clean install -pl esmf-samm-build-plugin
./mvnw -B clean package -pl esmf-semantic-aspect-meta-model
cd build/
mv site SAMM-snapshot
zip -r ../SAMM-snapshot-specification.zip SAMM-snapshot
- name: Upload build artifacts
uses: actions/upload-artifact@v2
if: env.ONLY_MD != 'true'
with:
name: samm-artifacts
path: |
esmf-semantic-aspect-meta-model/target/*.jar
SAMM-*-specification.zip