Skip to content

Documentation Auto Refresh #4

Documentation Auto Refresh

Documentation Auto Refresh #4

#
# This workflow compile and send analysis to sonarcloud
# + generate documentation and commit it to the wiki repository
# + trigger GHA on website's repository
#
name: Documentation Auto Refresh
on:
workflow_dispatch: # For manual trigger
schedule:
- cron: "0 0 * * 6"
jobs:
generating-documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Adopt OpenJDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
java-package: jdk
- name: Set custom runner parameters
run: |
echo "MAVEN_OPTS='-Dorg.slf4j.simpleLogger.defaultLogLevel=error -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xmx15g'" >> ~/.mavenrc
sudo chmod +x $GITHUB_WORKSPACE/travis/*
- name: Compiling gama
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
cd $GITHUB_WORKSPACE/gama.annotation
mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=gama-platform_new.gama
cd $GITHUB_WORKSPACE/gama.processor
mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=gama-platform_new.gama
cd $GITHUB_WORKSPACE/gama.parent
mvn -B -T 4 verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=gama-platform_new.gama
#- name: Get linux testing releases
# uses: actions/download-artifact@v4
# with:
# name: gama-compiled-archive
#
#- name: Extract GAMA w/o JDK
# run: tar xvf $GITHUB_WORKSPACE/gama.application-linux.gtk.x86_64.tar.gz
#
- name: Generate documentation
run: |
git clone --depth 1 https://github.com/gama-platform/gama.wiki.git $GITHUB_WORKSPACE/../gama.wiki
cd $GITHUB_WORKSPACE/gama.documentation/
java -cp ".:libs/jdom-2.0.1.jar:target/classes:../gama.annotations/target/classes" msi.gama.doc.MainGenerateWiki -online
- name: Trigger documentation website rebuild
run: |
curl -L --fail-with-body \
--request POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token ${{ secrets.BOT_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
--data '{"event_type": "automated-generation"}}' \
https://api.github.com/repos/gama-platform/gama-platform.github.io/dispatches