Test Actions #592
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
name: Test Actions | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
check-pom: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: GuillaumeFalourd/assert-command-line-output@v2.3 | |
with: | |
command_line: cat pom.xml | |
contains: JAVAVERSION | |
test-for-github-workflow: # Test the action with the GitHub workflow | |
needs: check-pom | |
continue-on-error: true | |
strategy: | |
matrix: | |
java: [8, 11, 17, 19, 21] | |
java-distribution: [adopt, zulu, temurin, corretto, microsoft, liberica] | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
project: [maven, gradle] | |
exclude: | |
- java: 8 | |
java-distribution: temurin | |
os: macos-latest | |
- java: 8 | |
java-distribution: adopt | |
os: macos-latest | |
- java: 8 | |
java-distribution: microsoft | |
- java: 19 | |
java-distribution: microsoft | |
- java: 19 | |
project: gradle | |
os: windows-latest | |
runs-on: ${{ matrix.os }} | |
name: Test Java ${{ matrix.java }} ${{ matrix.java-distribution }} ${{ matrix.project }} - ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Replace string in file | |
uses: MathieuSoysal/replace-string-in-file@v1.1.0 | |
with: | |
file: pom.xml | |
old-string: JAVAVERSION | |
new-string: ${{ matrix.java }} | |
- uses: ./ # Uses an action in the root directory | |
if: ${{ matrix.project == 'maven' }} | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
javadoc-branch: javadoc-test | |
java-version: ${{ matrix.java }} | |
target-folder: javadoc | |
project: ${{ matrix.project }} | |
java-distribution: ${{ matrix.java-distribution }} | |
without-deploy: true | |
without-checkout: true | |
custom-command: mvn javadoc:javadoc | |
- uses: ./ # Uses an action in the root directory | |
if: ${{ matrix.project == 'gradle' }} | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
javadoc-branch: javadoc-test | |
java-version: ${{ matrix.java }} | |
target-folder: javadoc | |
project: ${{ matrix.project }} | |
java-distribution: ${{ matrix.java-distribution }} | |
without-deploy: true | |
without-checkout: true | |
custom-command: gradle javadoc | |
- uses: GuillaumeFalourd/assert-command-line-output@v2.3 | |
if: ${{ matrix.project == 'maven' }} | |
with: | |
command_line: cat target/site/apidocs/index.html | |
contains: javadoc | |
- uses: GuillaumeFalourd/assert-command-line-output@v2.3 | |
if: ${{ matrix.project == 'gradle' }} | |
with: | |
command_line: cat build/docs/javadoc/index.html | |
contains: javadoc |