forked from gwtproject/gwt
-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (103 loc) · 4.29 KB
/
full-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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Run all tests and builds all aspects of GWT using Java 11, 17, and 21. Runs
# nightly (plus or minus timzeones) on the main branch, and will also run right
# away on a push to a release branch. Release zips are uploaded as part of the
# build, though maven snapshots are not yet deployed.
name: Full build
on:
schedule:
# This time is selected to be early in the morning in NA/SA/EU/ME. This
# only runs on the default branch.
- cron: '0 6 * * *'
push:
# Build on pushes to main and release branches. For forks, the -test may
# be helpful to run tests when preparing a merge.
branches:
- 'main'
- 'release/*'
- '*-test'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ '11', '17', '21', '22' ]
steps:
- name: Checkout GWT itself into one directory
uses: actions/checkout@v4
with:
path: 'gwt'
- name: Checkout GWT tools into a sibling directory
uses: actions/checkout@v4
with:
repository: 'gwtproject/tools'
path: 'tools'
- name: Set up JDK ${{ matrix.java-version }}
# GWT requires Java 11+ to build
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
- name: Build, style/api checks, test, produce docs
run: |
set -eux
cd gwt
java -version
ant -version
# Set env vars to ensure we get the build/test we expect
export \
TZ=America/Los_Angeles \
ANT_OPTS='-Dfile.encoding=UTF8 -Xmx2g' \
GWT_VERSION=HEAD-SNAPSHOT
# Run the ant tasks, disabling watchFileChanges to work around a github actions limitation
ant clean test dist doc \
-Dtest.jvmargs='-ea -Dgwt.watchFileChanges=false' \
-Dtest.web.htmlunit.disable=true \
-Dtest.nometa.htmlunit.disable=true \
-Dtest.emma.htmlunit.disable=true
- name: Report test results
uses: mikepenz/action-junit-report@v4.3.1
if: always()
with:
report_paths: 'gwt/build/out/**/test/**/reports/TEST-*.xml'
- name: Upload checkstyle xml for manual review in its own artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: checkstyle-reports-java${{ matrix.java-version }}
path: 'gwt/build/out/**/checkstyle*.xml'
- name: Upload test xml files for manual review in its own artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: junit-reports-java${{ matrix.java-version }}
path: 'gwt/build/out/**/test/**/reports/TEST-*.xml'
- name: On success, upload the release zip
uses: actions/upload-artifact@v4
with:
name: gwt-java${{ matrix.java-version }}
path: 'gwt/build/dist/gwt-*.zip'
- name: Set up sonatype credentials
# Using the same java version as above, set up a settings.xml file
uses: actions/setup-java@v4
if: ${{ github.event_name == 'schedule' && github.repository_owner == 'gwtproject' && matrix.java-version == '21' }}
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
# Define the ID for the server to put in settings.xml, and the env vars that will contain the secrets
server-id: sonatype-snapshots
server-username: SONATYPE_USERNAME
server-password: SONATYPE_PASSWORD
- name: Nightly builds should be deployed as snapshots to sonatype
if: ${{ github.event_name == 'schedule' && github.repository_owner == 'gwtproject' && matrix.java-version == '21' }}
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
run: |
set -eux
# Set the version to deploy (it was also set in the build step above)
export GWT_VERSION=HEAD-SNAPSHOT
export GWT_MAVEN_REPO_URL=https://oss.sonatype.org/content/repositories/snapshots/
export GWT_MAVEN_REPO_ID=sonatype-snapshots
cd gwt
# With no user input, run the push-gwtproject.sh script to deploy org.gwtproject artifacts
maven/push-gwtproject.sh < /dev/null