Skip to content

Commit

Permalink
Add new workflow to generate javadoc
Browse files Browse the repository at this point in the history
Add GitHub workflow to automatically generate the javadoc HTML
and publish to GitHub Pages. Also bump version of actions used
in the existing workflows.
  • Loading branch information
AG6GR committed Jan 7, 2024
1 parent 853b2cb commit ef8a1f2
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 5 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
- name: Cache Gradle packages
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Build with Gradle
run: ./gradlew build
- name: Save built output
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: libs
path: build/libs
2 changes: 1 addition & 1 deletion .github/workflows/checkstyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4
- name: Set up Checkstyle
run: sudo apt-get install -y checkstyle
- name: Run checkstyle
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/javadoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Javadoc

on:
# Only run for pushes to main branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Generate Javadoc with Gradle
run: ./gradlew javadoc
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'build/docs/javadoc'
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ test {
systemProperty 'junit.jupiter.extensions.autodetection.enabled', 'true'
}

javadoc {
source = sourceSets.main.allJava
}

// Simulation configuration (e.g. environment variables).
wpi.sim.addGui().defaultEnabled = true
wpi.sim.addDriverstation()
Expand Down

0 comments on commit ef8a1f2

Please sign in to comment.