Documentation Auto Refresh #1
Workflow file for this run
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
# | |
# 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='-Xmx15g'" >> ~/.mavenrc | |
- name: Cache SonarCloud packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Compiling GAMA | |
run: bash travis/build.sh -B -T 4 -Dorg.slf4j.simpleLogger.defaultLogLevel=error | |
- name: SonarCloud analysis | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: | | |
cd $GITHUB_WORKSPACE/gama.parent && pwd | |
mvn -B 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" gama.documentation.MainGenerateWiki -online | |
- name: Trigger documentation website rebuild | |
run: | | |
curl --request POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: token ${{ secrets.BOT_TOKEN }}" \ | |
--data '{"event_type": "automated-generation"}' \ | |
https://api.github.com/repos/gama-platform/gama-platform.github.io/dispatches |