Skip to content

Commit 88d35d7

Browse files
committed
Add initial Github CI
Add .github/workflows/main.yml; update build.gradle to not fail build on Javadoc errors See: https://freenet.mantishub.io/view.php?id=7179
1 parent 95b91d6 commit 88d35d7

File tree

3 files changed

+76
-1
lines changed

3 files changed

+76
-1
lines changed

.github/workflows/main.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Reference: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
2+
3+
name: Java CI with Gradle
4+
5+
#on: [push, pull_request]
6+
on:
7+
push:
8+
branches: [ '**' ]
9+
pull_request:
10+
branches: [ '**' ]
11+
12+
# Allow running from Actions tab
13+
workflow_dispatch:
14+
15+
permissions:
16+
# Reference: https://github.blog/changelog/2021-04-20-github-actions-control-permissions-for-github_token/
17+
contents: read
18+
19+
jobs:
20+
build:
21+
strategy:
22+
matrix:
23+
# TODO Fix freenet.client.filter.M3UFilterTest on Windows, enable Windows builds
24+
#os: [macos-latest, ubuntu-latest, windows-latest]
25+
os: [macos-latest, ubuntu-latest]
26+
distribution: [temurin]
27+
# TODO What JDK versions are needed?
28+
# TODO Fix freenet.support.compress.GzipCompressorTest on Java 16, enable 16 builds
29+
#java: [8, 11, 16]
30+
java: [8, 11]
31+
32+
runs-on: ${{ matrix.os }}
33+
34+
steps:
35+
- uses: actions/checkout@v3
36+
37+
- uses: gradle/wrapper-validation-action@v1
38+
39+
- uses: actions/setup-java@v3
40+
with:
41+
cache: 'gradle'
42+
distribution: '${{ matrix.distribution }}'
43+
java-version: '${{ matrix.java }}'
44+
45+
- name: before_install
46+
run: |
47+
echo "" > gradle.properties # Force empty gradle.properties file
48+
echo "org.gradle.configureondemand=true" >> gradle.properties
49+
echo "org.gradle.jvmargs=-Xms256m -Xmx1024m" >> gradle.properties
50+
echo "org.gradle.parallel = true" >> gradle.properties
51+
echo "tasks.withType(Test) { maxParallelForks = Runtime.runtime.availableProcessors() }" >> gradle.properties
52+
cat gradle.properties
53+
54+
- name: gradle --warning-mode all
55+
run: |
56+
echo "Run Gradle in pedantic mode to flush out Gradle upgrade issues"
57+
./gradlew --warning-mode all
58+
59+
- name: gradle javadoc
60+
run: |
61+
./gradlew javadoc
62+
63+
- name: gradle jar
64+
run: |
65+
./gradlew jar
66+
67+
- name: gradle copyRuntimeLib
68+
run: |
69+
./gradlew copyRuntimeLib
70+
71+
- name: gradle test
72+
run: |
73+
./gradlew test
74+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*.ipr
1717
*.iws
1818
.*
19+
!.github
1920
*~
2021
\#*\#
2122
/override.properties

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,6 @@ task tar(type: Tar) {
275275
}
276276
}
277277

278-
javadoc << {
278+
javadoc {
279279
failOnError false
280280
}

0 commit comments

Comments
 (0)