-
Notifications
You must be signed in to change notification settings - Fork 387
147 lines (145 loc) · 5.37 KB
/
maven.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: cldr-mvn
on:
push:
pull_request:
workflow_dispatch:
inputs:
git-ref:
description: Git Ref (Optional)
required: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@v3
with:
lfs: false
if: github.event.inputs.git-ref == ''
- name: Clone Repository (manual ref)
uses: actions/checkout@v3
with:
lfs: false
ref: ${{ github.event.inputs.git-ref }}
if: github.event.inputs.git-ref != ''
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('tools/**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Cache local npm repository
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
node-
- name: Lint GitHub Actions
run: npx yaml-lint .github/workflows/*.yml
- name: Build with Maven
run: >
mvn -s .github/workflows/mvn-settings.xml -B compile install package --file tools/pom.xml
-DskipTests=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build liberty server
run: >
mvn -s .github/workflows/mvn-settings.xml -B -pl cldr-apps liberty:create liberty:deploy liberty:package -Dinclude=usr --file tools/pom.xml
-DskipTests=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Cleanup liberty server
run: >
zip tools/cldr-apps/target/cldr-apps.zip -d wlp/usr/servers/cldr/apps/expanded/\*
- name: Upload cldr-apps.zip
uses: actions/upload-artifact@v2
with:
name: cldr-apps-server
path: tools/cldr-apps/target/cldr-apps.zip
- name: Upload cldr-code.jar
uses: actions/upload-artifact@v2
with:
name: cldr-code
path: tools/cldr-code/target/cldr-code.jar
- name: BOM check in .xml files
run: >
mvn -s .github/workflows/mvn-settings.xml --file tools/pom.xml -pl cldr-code
exec:java -Dexec.mainClass=org.unicode.cldr.util.XMLValidator
-Dexec.cleanupDaemonThreads=false
-Dexec.args="-q --justCheckBom exemplars seed common keyboards"
&& echo 'No XML BOM detected'
- name: Setup MySQL
run: |
sudo systemctl start mysql.service
sleep 3
mysql --user=root --password=root < tools/cldr-apps/test-setup.sql
- name: Test with maven
run: >
mvn -s .github/workflows/mvn-settings.xml -B test --file tools/pom.xml
'-Dorg.unicode.cldr.unittest.web.jdbcurl=jdbc:mysql://cldrtest:VbrB3LFCr6A!@localhost/cldrtest?useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC'
'-Dorg.unicode.cldr.unittest.web.KeepDb=true' -DCLDR_GITHUB_ANNOTATIONS=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
check:
needs: build
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@v3
with:
lfs: false
if: github.event.inputs.git-ref == ''
- name: Clone Repository (manual ref)
uses: actions/checkout@v3
with:
lfs: false
ref: ${{ github.event.inputs.git-ref }}
if: github.event.inputs.git-ref != ''
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11
- name: Download cldr-code.jar
uses: actions/download-artifact@v2
with:
name: cldr-code
path: tools/cldr-code/target/
- name: run CLDR console check
run: java -DCLDR_GITHUB_ANNOTATIONS=true -DCLDR_DIR=$(pwd) -Xmx6g -jar tools/cldr-code/target/cldr-code.jar check -S common,seed -e -z FINAL_TESTING
deploy:
# don't run deploy on manual builds!
if: github.repository == 'unicode-org/cldr' && github.event_name == 'push' && github.ref == 'refs/heads/main' && github.event.inputs.git-ref == ''
needs:
- build
- check
runs-on: ubuntu-latest
steps:
- name: Download cldr-apps.zip
uses: actions/download-artifact@v2
with:
name: cldr-apps-server
- name: Deploy to cldr-smoke
# Deploys only on push to main.
# Does not deploy for PRs.
if: ${{ github.event_name == 'push' }}
shell: bash
env:
# the RSA key for connecting
RSA_KEY_SURVEYTOOL: ${{ secrets.RSA_KEY_SURVEYTOOL }}
# the SSH port
SMOKETEST_PORT: ${{ secrets.SMOKETEST_PORT }}
# the SSH host
SMOKETEST_HOST: ${{ secrets.SMOKETEST_HOST }}
# the ~/.ssh/known_hosts line mentioning SMOKETEST_HOST
SMOKETEST_KNOWNHOSTS: ${{ secrets.SMOKETEST_KNOWNHOSTS }}
run: |
echo "${RSA_KEY_SURVEYTOOL}" > .key && chmod go= .key
echo "${SMOKETEST_KNOWNHOSTS}" > .knownhosts && chmod go= .knownhosts
ssh -C -o UserKnownHostsFile=.knownhosts -i .key -p ${SMOKETEST_PORT} surveytool@${SMOKETEST_HOST} bash /usr/local/bin/deploy-to-openliberty.sh < cldr-apps.zip ${GITHUB_SHA} --override