From 7491e546922ed62d764f0d476802144927c8d3bf Mon Sep 17 00:00:00 2001 From: Aurora Lahtela <24460436+AuroraLS3@users.noreply.github.com> Date: Sun, 30 Oct 2022 10:47:59 +0200 Subject: [PATCH] Merge javadocs pipeline to ci pipeline Affects issues: - Close #2677 --- .github/workflows/ci.yml | 42 ++++++++++++++++++++++-------- .github/workflows/javadocs.yml | 47 ---------------------------------- 2 files changed, 32 insertions(+), 57 deletions(-) delete mode 100644 .github/workflows/javadocs.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 891d4dd64..91ba1da6f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,26 +25,26 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 0 - - name: Setup JDK + - name: ☕ Setup JDK uses: actions/setup-java@v2 with: distribution: 'adopt' java-version: '17' - - name: Setup Selenium Webdriver + - name: 🚦 Setup Selenium Webdriver uses: nanasess/setup-chromedriver@v1 - name: Setup Selenium Webdriver settings run: | export DISPLAY=:99 chromedriver --url-base=/wd/hub & sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & - - name: Verify MariaDB connection + - name: 📶 Verify MariaDB connection env: PORT: ${{ job.services.mariadb.ports[3306] }} run: | while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do sleep 1 done - - name: Cache Gradle packages + - name: 💼 Load Gradle Cache uses: actions/cache@v2 with: path: | @@ -53,11 +53,11 @@ jobs: key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} restore-keys: | ${{ runner.os }}-gradle- - - name: Build jars + - name: 🛠 Build jars run: | cd Plan ./gradlew shadowJar - - name: Get versions + - name: Get versions 🛒 run: | cd Plan ./gradlew snapshotVersion jarNameVersion @@ -66,17 +66,17 @@ jobs: echo "snapshotVersion=$(cat build/versions/snapshot.txt)" >> $GITHUB_ENV echo "versionString=$(cat build/versions/jar.txt)" >> $GITHUB_ENV echo "artifactPath=$(pwd)/builds" >> $GITHUB_ENV - - name: Upload Plan.jar + - name: 📤 Upload Plan.jar uses: actions/upload-artifact@v3 with: name: Plan-${{ env.versionString }}-${{ env.git_hash }}.jar path: ${{ env.artifactPath }}/Plan-${{ env.snapshotVersion }}.jar - - name: Upload PlanFabric.jar + - name: 📤 Upload PlanFabric.jar uses: actions/upload-artifact@v3 with: name: PlanFabric-${{ env.versionString }}-${{ env.git_hash }}.jar path: ${{ env.artifactPath }}/PlanFabric-${{ env.snapshotVersion }}.jar - - name: Test + - name: 🩺 Test env: MYSQL_DB: test MYSQL_USER: user @@ -86,7 +86,29 @@ jobs: run: | cd Plan ./gradlew build - - name: SonarCloud + - name: 🖨 Build Javadocs + if: github.ref == 'refs/heads/master' + run: | + cd Plan + echo "Building javadocs with gradle" + ./gradlew aggregateJavadocs + echo "Moving to working directory:" + cd ../ + mkdir javadocs + mkdir javadocs/all + mkdir javadocs/api + cp -r Plan/build/docs/javadoc/* javadocs/all/ + cp -r Plan/api/build/docs/javadoc/* javadocs/api/ + cp scripts/index.html javadocs/index.html + cd javadocs + touch .nojekyll + - name: 🖨 Deploy Javadocs + if: github.ref == 'refs/heads/master' + uses: JamesIves/github-pages-deploy-action@4.1.4 + with: + branch: gh-pages # The branch the action should deploy to. + folder: javadocs # The folder the action should deploy. + - name: 🩺 SonarCloud env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/javadocs.yml b/.github/workflows/javadocs.yml deleted file mode 100644 index 62a1b469d..000000000 --- a/.github/workflows/javadocs.yml +++ /dev/null @@ -1,47 +0,0 @@ -# This workflow will build a Java project with Gradle -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - -name: Automatically Deploy Javadocs - -on: - push: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - name: Checkout 🛎️ - uses: actions/checkout@v2.3.1 - - - name: Set up JDK 🍵 - uses: actions/setup-java@v2 - with: - distribution: 'adopt' - java-version: '17' - - name: Build Javadocs 🔧 - run: | - cd Plan - echo "Building javadocs with gradle" - ./gradlew aggregateJavadocs - echo "Moving to working directory:" - cd ../ - mkdir javadocs - mkdir javadocs/all - mkdir javadocs/api - cp -r Plan/build/docs/javadoc/* javadocs/all/ - cp -r Plan/api/build/docs/javadoc/* javadocs/api/ - cp scripts/index.html javadocs/index.html - cd javadocs - touch .nojekyll - - - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@4.1.4 - with: - branch: gh-pages # The branch the action should deploy to. - folder: javadocs # The folder the action should deploy. - - -