Skip to content

Java CI

Java CI #3191

Workflow file for this run

name: Java CI
on:
schedule:
- cron: "0 */6 * * *" # every 6 hours
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Install Graphviz
uses: tlylt/install-graphviz@v1
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Fetch all micronaut-projects modules
id: module-fetch
run: |
MODULES=$(gh api graphql --paginate -f query='query {
search(query: "user:micronaut-projects archived:false", type: REPOSITORY, first: 100) {
nodes {
... on Repository {
name
defaultBranchRef {
name
}
}
}
}
}' --template '{{range .data.search.nodes}}{{.name}}{{"@"}}{{.defaultBranchRef.name}}{{","}}{{end}}')
echo "Fetched modules: $MODULES"
echo "MICRONAUT_MODULES=$MODULES" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ github.token }}
- name: Execute Gradle build
run: ./gradlew allReports graphBuilder
env:
MICRONAUT_MODULES: ${{ steps.module-fetch.outputs.MICRONAUT_MODULES }}
GH_TOKEN_PUBLIC_REPOS_READONLY: ${{ secrets.GH_TOKEN_PUBLIC_REPOS_READONLY }}
GH_USERNAME: ${{ secrets.GH_USERNAME }}
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }}
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: report
path: |
build/graph/*.png
build/reports/**/*
- name: Deploy to GH Pages 🚀
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: build/graph