2019-09-27 07:56:53 +00:00
|
|
|
name: Build
|
2019-09-14 08:16:13 +00:00
|
|
|
|
2019-09-30 14:37:52 +00:00
|
|
|
on: [push, pull_request]
|
2019-09-14 08:16:13 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2019-12-03 23:26:13 +00:00
|
|
|
name: Build
|
2019-09-14 08:16:13 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2020-02-08 11:02:09 +00:00
|
|
|
- uses: actions/checkout@v2
|
2019-09-14 08:16:13 +00:00
|
|
|
|
Generate documentation stubs from Javadocs
illuaminate does not handle Java files, for obvious reasons. In order to
get around that, we have a series of stub files within /doc/stub which
mirrored the Java ones. While this works, it has a few problems:
- The link to source code does not work - it just links to the stub
file.
- There's no guarantee that documentation remains consistent with the
Java code. This change found several methods which were incorrectly
documented beforehand.
We now replace this with a custom Java doclet[1], which extracts doc
comments from @LuaFunction annotated methods and generates stub-files
from them. These also contain a @source annotation, which allows us to
correctly link them back to the original Java code.
There's some issues with this which have yet to be fixed. However, I
don't think any of them are major blockers right now:
- The custom doclet relies on Java 9 - I think it's /technically/
possible to do this on Java 8, but the API is significantly uglier.
This means that we need to run javadoc on a separate JVM.
This is possible, and it works locally and on CI, but is definitely
not a nice approach.
- illuaminate now requires the doc stubs to be generated in order for
the linter to pass, which does make running the linter locally much
harder (especially given the above bullet point).
We could notionally include the generated stubs (or at least a cut
down version of them) in the repo, but I'm not 100% sure about that.
[1]: https://docs.oracle.com/javase/9/docs/api/jdk/javadoc/doclet/package-summary.html
2020-07-03 12:31:26 +00:00
|
|
|
- name: Set up Java 8
|
2019-09-14 08:16:13 +00:00
|
|
|
uses: actions/setup-java@v1
|
|
|
|
with:
|
Generate documentation stubs from Javadocs
illuaminate does not handle Java files, for obvious reasons. In order to
get around that, we have a series of stub files within /doc/stub which
mirrored the Java ones. While this works, it has a few problems:
- The link to source code does not work - it just links to the stub
file.
- There's no guarantee that documentation remains consistent with the
Java code. This change found several methods which were incorrectly
documented beforehand.
We now replace this with a custom Java doclet[1], which extracts doc
comments from @LuaFunction annotated methods and generates stub-files
from them. These also contain a @source annotation, which allows us to
correctly link them back to the original Java code.
There's some issues with this which have yet to be fixed. However, I
don't think any of them are major blockers right now:
- The custom doclet relies on Java 9 - I think it's /technically/
possible to do this on Java 8, but the API is significantly uglier.
This means that we need to run javadoc on a separate JVM.
This is possible, and it works locally and on CI, but is definitely
not a nice approach.
- illuaminate now requires the doc stubs to be generated in order for
the linter to pass, which does make running the linter locally much
harder (especially given the above bullet point).
We could notionally include the generated stubs (or at least a cut
down version of them) in the repo, but I'm not 100% sure about that.
[1]: https://docs.oracle.com/javase/9/docs/api/jdk/javadoc/doclet/package-summary.html
2020-07-03 12:31:26 +00:00
|
|
|
java-version: 8
|
2019-09-14 08:16:13 +00:00
|
|
|
|
2022-09-11 13:11:32 +00:00
|
|
|
- name: Cache Gradle dependencies
|
2021-01-15 19:39:12 +00:00
|
|
|
uses: actions/cache@v2
|
2020-02-08 11:17:45 +00:00
|
|
|
with:
|
|
|
|
path: ~/.gradle/caches
|
|
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle.properties') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-gradle-
|
|
|
|
|
2021-04-28 20:24:27 +00:00
|
|
|
- name: Disable Gradle daemon
|
|
|
|
run: |
|
|
|
|
mkdir -p ~/.gradle
|
|
|
|
echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties
|
|
|
|
|
2019-09-14 08:16:13 +00:00
|
|
|
- name: Build with Gradle
|
2021-01-09 19:50:27 +00:00
|
|
|
run: |
|
2021-04-28 20:24:27 +00:00
|
|
|
./gradlew assemble || ./gradlew assemble
|
|
|
|
./gradlew downloadAssets || ./gradlew downloadAssets
|
2022-09-11 13:11:32 +00:00
|
|
|
./gradlew build
|
2021-01-09 19:50:27 +00:00
|
|
|
|
2020-01-01 00:08:31 +00:00
|
|
|
- name: Upload Jar
|
2021-01-15 19:39:12 +00:00
|
|
|
uses: actions/upload-artifact@v2
|
2020-01-01 00:08:31 +00:00
|
|
|
with:
|
|
|
|
name: CC-Tweaked
|
|
|
|
path: build/libs
|
|
|
|
|
2022-09-11 13:11:32 +00:00
|
|
|
- name: Upload coverage
|
2021-08-20 21:33:09 +00:00
|
|
|
uses: codecov/codecov-action@v2
|
2021-05-17 16:31:58 +00:00
|
|
|
|
|
|
|
- name: Parse test reports
|
|
|
|
run: ./tools/parse-reports.py
|
|
|
|
if: ${{ failure() }}
|
2020-05-11 14:41:39 +00:00
|
|
|
|
2021-04-28 20:24:27 +00:00
|
|
|
- name: Run linters
|
2022-09-11 13:11:32 +00:00
|
|
|
uses: pre-commit/action@v3.0.0
|