-
Notifications
You must be signed in to change notification settings - Fork 18
89 lines (79 loc) · 2.71 KB
/
test-action-final.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Test Actions
on:
schedule:
- cron: '0 0 * * *'
pull_request:
branches:
- main
jobs:
check-pom:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: GuillaumeFalourd/assert-command-line-output@v2
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, 16, 17, 18, 19]
java-distribution: [adopt, zulu, temurin, corretto, microsoft, liberica]
os: [ubuntu-latest, windows-latest, macos-latest]
project: [maven, gradle]
exclude:
- java: 8
java-distribution: microsoft
- java: 18
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@v3
- name: Replace string in file
uses: MathieuSoysal/replace-string-in-file@v1.0.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
if: ${{ matrix.project == 'maven' }}
with:
command_line: cat target/site/apidocs/index.html
contains: javadoc
- uses: GuillaumeFalourd/assert-command-line-output@v2
if: ${{ matrix.project == 'gradle' }}
with:
command_line: cat build/docs/javadoc/index.html
contains: javadoc