CI #2171
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [main] | |
release: | |
types: [created] | |
workflow_dispatch: | |
pull_request: | |
schedule: | |
- cron: '20 3 * * *' # run nightly at 3:20 am | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
exclude: | |
- os: windows-latest # TODO: Windows builds currently fail as documented in https://github.com/vitruv-tools/Vitruv-CaseStudies/issues/241 | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Support Longpaths [Windows] | |
if: matrix.os == 'windows-latest' | |
run: git config --system core.longpaths true | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml', '**/MANIFEST.MF') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: Build and Verify | |
uses: coactions/setup-xvfb@v1 | |
with: | |
run: > | |
./mvnw -B clean verify | |
-Dstyle.color=always | |
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn | |
-Dorg.slf4j.simpleLogger.log.org.eclipse.tycho.core.resolver.DefaultTychoResolver=warn | |
-Dorg.slf4j.simpleLogger.log.org.eclipse.tycho.osgi.configuration.MavenContextConfigurator=warn | |
-Dorg.slf4j.simpleLogger.log.org.eclipse.sisu.equinox.launching.internal.DefaultEquinoxLauncher=warn | |
-Dorg.slf4j.simpleLogger.log.org.eclipse.xtext.maven.XtextGenerateMojo=warn | |
env: | |
MAVEN_OPTS: -Djansi.force=true | |
- name: Publish Nightly Update Site | |
if: github.event_name != 'release' && github.ref == 'refs/heads/main' && github.repository_owner == 'vitruv-tools' && matrix.os == 'ubuntu-latest' | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
deploy_key: ${{ secrets.UPDATE_SITE_DEPLOY_KEY }} | |
external_repository: vitruv-tools/updatesite | |
destination_dir: nightly/case-studies | |
publish_dir: releng/tools.vitruv.applications.cbs.updatesite/target/repository | |
publish_branch: main | |
user_name: 'github-actions[bot]' | |
user_email: 'github-actions[bot]@users.noreply.github.com' | |
- name: Publish Release Update Site | |
if: github.event_name == 'release' && github.repository_owner == 'vitruv-tools' && matrix.os == 'ubuntu-latest' | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
deploy_key: ${{ secrets.UPDATE_SITE_DEPLOY_KEY }} | |
external_repository: vitruv-tools/updatesite | |
destination_dir: release/case-studies/${{ github.event.release.tag_name }} | |
publish_dir: releng/tools.vitruv.applications.cbs.updatesite/target/repository | |
publish_branch: main | |
user_name: 'github-actions[bot]' | |
user_email: 'github-actions[bot]@users.noreply.github.com' |