forked from gwtproject/gwt
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (63 loc) · 2.54 KB
/
quick-check.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
# Run simple checks to make sure that the build is sane when any branch is pushed or pull
# request created. Comments or annotations will be added to a pull request in the case of
# style guide violations. Presently, tests are not run on pull requests.
name: Quick smoke test
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: ['8', '11', '17']
steps:
- name: Checkout GWT itself into one directory
uses: actions/checkout@v2
with:
path: 'gwt'
# we need depth=2 to see which style violations overlap with the current changes
fetch-depth: 2
- name: Checkout GWT tools into a sibling directory
uses: actions/checkout@v2
with:
repository: 'gwtproject/tools'
path: 'tools'
- name: Set up JDK ${{ matrix.java-version }}
# GWT presently requires Java8 to build just the SDK and some tests, or 11+ to build everything, and can run on newer Java versions
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
- name: Set up reviewdog for easier checks on the PR's checkstyle output
uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- name: Build, style/api checks, produce docs
# Presently this runs no tests at all, but could run quick tests
run: |
set -eux
cd gwt
# Set env vars to ensure we get the build we expect
export \
TZ=America/Los_Angeles \
ANT_OPTS=-Dfile.encoding=UTF8 \
ANT_OPTS=-Xmx2g
ant clean dist doc checkstyle apicheck
- name: Create pull request comments/annotations for checkstyle from the java 17 build, even on failure
if: ${{ always() && github.event_name == 'pull_request' && matrix.java-version == '17' }}
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -eux
shopt -s globstar
cd gwt
for f in build/out/**/checkstyle*.xml ; do
echo $f
reviewdog -f=checkstyle -filter-mode=diff_context -reporter=github-pr-review -level=info < $f
done
- name: Upload checkstyle xml for manual review
uses: actions/upload-artifact@v2
if: ${{ matrix.java-version == '17' }}
with:
name: checkstyle-reports-java${{ matrix.java-version }}
path: 'gwt/build/out/**/checkstyle*.xml'
retention-days: 5