Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 42 additions & 2 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,55 @@ name: Build and Publish
on:
push:
branches: [ "master" ]
paths:
- 'gradle/wrapper/**'
- '**/*.gradle'
- '**/*.java'
- '**/*.md'
- '**/*.adoc'
pull_request:
branches: [ "master" ]
types: [opened, synchronize, reopened]
paths:
- 'gradle/wrapper/**'
- '**/*.gradle'
- '**/*.java'
- '**/*.md'
- '**/*.adoc'

permissions:
contents: write
pull-requests: write

jobs:
check-changes:
name: Check for file changes
runs-on: ubuntu-latest
outputs:
java-changes: ${{ steps.filter.outputs.java }}
readme-changes: ${{ steps.filter.outputs.readme }}
build-changes: ${{ steps.filter.outputs.build }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
java:
- '**/*.java'
readme:
- '**/*.md'
- '**/*.adoc'
build:
- 'gradle/wrapper/**'
- '**/*.gradle'

gradle-build:
name: Build project with Gradle
needs: check-changes
if: ${{ needs.check-changes.outputs.java-changes == 'true' || needs.check-changes.outputs.build-changes == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -45,6 +83,7 @@ jobs:
- name: Run CI build
run: ./gradlew build
- name: Publish test coverage
if: ${{ needs.check-changes.outputs.java-changes == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand All @@ -53,13 +92,14 @@ jobs:
asciidoc-build:
# The type of runner that the job will run on
name: Generate articles with Ascii Doctor
needs: [check-changes, gradle-build]
if: ${{ needs.check-changes.outputs.readme-changes == 'true' }}
runs-on: ubuntu-latest
needs: gradle-build
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

# Includes the AsciiDoctor GitHub Pages Action to convert adoc files to html and publish to gh-pages branch
- name: asciidoctor-ghpages
uses: manoelcampos/asciidoctor-ghpages-action@v2
uses: manoelcampos/asciidoctor-ghpages-action@v2
6 changes: 6 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@ name: "CodeQL"
on:
push:
branches: [ "master" ]
paths:
- '**/*.java'
- '**/*.gradle'
pull_request:
branches: [ "master" ]
paths:
- '**/*.java'
- '**/*.gradle'
schedule:
- cron: '25 21 * * 0'

Expand Down