Skip to content

Commit 89c5a6a

Browse files
authored
ci: add gh-actions workflows (apache#903)
1 parent 9bc8f76 commit 89c5a6a

File tree

4 files changed

+365
-0
lines changed

4 files changed

+365
-0
lines changed

.github/workflows/android.yml

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: Android Testsuite
19+
20+
on:
21+
push:
22+
paths-ignore:
23+
- '**.md'
24+
- 'LICENSE'
25+
- '.eslint*'
26+
pull_request:
27+
paths-ignore:
28+
- '**.md'
29+
- 'LICENSE'
30+
- '.eslint*'
31+
32+
jobs:
33+
test:
34+
name: Android ${{ matrix.versions.android }} Test
35+
runs-on: macos-latest
36+
37+
# hoist configurations to top that are expected to be updated
38+
env:
39+
# Storing a copy of the repo
40+
repo: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
41+
42+
node-version: 16
43+
44+
# These are the default Java configurations used by most tests.
45+
# To customize these options, add "java-distro" or "java-version" to the strategy matrix with its overriding value.
46+
default_java-distro: adopt
47+
default_java-version: 8
48+
49+
# These are the default Android System Image configurations used by most tests.
50+
# To customize these options, add "system-image-arch" or "system-image-target" to the strategy matrix with its overriding value.
51+
default_system-image-arch: x86_64
52+
default_system-image-target: google_apis # Most system images have a google_api option. Set this as default.
53+
54+
# configurations for each testing strategy (test matrix)
55+
strategy:
56+
matrix:
57+
versions:
58+
- android: 5.1
59+
android-api: 22
60+
61+
- android: 6
62+
android-api: 23
63+
64+
- android: 7
65+
android-api: 24
66+
67+
- android: 7.1
68+
android-api: 25
69+
70+
- android: 8
71+
android-api: 26
72+
73+
- android: 8.1
74+
android-api: 27
75+
system-image-target: default
76+
77+
- android: 9
78+
android-api: 28
79+
80+
- android: 10
81+
android-api: 29
82+
83+
- android: 11
84+
android-api: 30
85+
java-version: 11
86+
87+
timeout-minutes: 60
88+
89+
steps:
90+
- uses: actions/checkout@v2
91+
- uses: actions/setup-node@v2
92+
with:
93+
node-version: ${{ env.node-version }}
94+
- uses: actions/setup-java@v2
95+
env:
96+
java-version: ${{ matrix.versions.java-version == '' && env.default_java-version || matrix.versions.java-version }}
97+
java-distro: ${{ matrix.versions.java-distro == '' && env.default_java-distro || matrix.versions.java-distro }}
98+
with:
99+
distribution: ${{ env.java-distro }}
100+
java-version: ${{ env.java-version }}
101+
102+
- name: Run Environment Information
103+
run: |
104+
node --version
105+
npm --version
106+
java -version
107+
108+
- name: Run npm install
109+
run: |
110+
export PATH="/usr/local/lib/android/sdk/platform-tools":$PATH
111+
export JAVA_HOME=$JAVA_HOME_11_X64
112+
npm i -g cordova@latest
113+
npm ci
114+
115+
- name: Run paramedic install
116+
if: ${{ endswith(env.repo, '/cordova-paramedic') != true }}
117+
run: npm i -g github:apache/cordova-paramedic
118+
119+
- uses: reactivecircus/android-emulator-runner@5de26e4bd23bf523e8a4b7f077df8bfb8e52b50e
120+
env:
121+
system-image-arch: ${{ matrix.versions.system-image-arch == '' && env.default_system-image-arch || matrix.versions.system-image-arch }}
122+
system-image-target: ${{ matrix.versions.system-image-target == '' && env.default_system-image-target || matrix.versions.system-image-target }}
123+
with:
124+
api-level: ${{ matrix.versions.android-api }}
125+
target: ${{ env.system-image-target }}
126+
arch: ${{ env.system-image-arch }}
127+
force-avd-creation: false
128+
disable-animations: false
129+
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim
130+
script: echo "Pregenerate the AVD before running Paramedic"
131+
132+
- name: Run paramedic tests
133+
uses: reactivecircus/android-emulator-runner@5de26e4bd23bf523e8a4b7f077df8bfb8e52b50e
134+
env:
135+
system-image-arch: ${{ matrix.versions.system-image-arch == '' && env.default_system-image-arch || matrix.versions.system-image-arch }}
136+
system-image-target: ${{ matrix.versions.system-image-target == '' && env.default_system-image-target || matrix.versions.system-image-target }}
137+
test_config: 'android-${{ matrix.versions.android }}.config.json'
138+
# Generally, this should automatically work for cordova-paramedic & plugins. If the path is unique, this can be manually changed.
139+
test_plugin_path: ${{ endswith(env.repo, '/cordova-paramedic') && './spec/testable-plugin/' || './' }}
140+
paramedic: ${{ endswith(env.repo, '/cordova-paramedic') && 'node main.js' || 'cordova-paramedic' }}
141+
with:
142+
api-level: ${{ matrix.versions.android-api }}
143+
target: ${{ env.system-image-target }}
144+
arch: ${{ env.system-image-arch }}
145+
force-avd-creation: false
146+
disable-animations: false
147+
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim
148+
script: ${{ env.paramedic }} --config ./pr/local/${{ env.test_config }} --plugin ${{ env.test_plugin_path }}

.github/workflows/chrome.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: Chrome Testsuite
19+
20+
on:
21+
push:
22+
paths-ignore:
23+
- '**.md'
24+
- 'LICENSE'
25+
- '.eslint*'
26+
pull_request:
27+
paths-ignore:
28+
- '**.md'
29+
- 'LICENSE'
30+
- '.eslint*'
31+
32+
jobs:
33+
test:
34+
name: Chrome Latest Test
35+
runs-on: ubuntu-latest
36+
37+
# hoist configurations to top that are expected to be updated
38+
env:
39+
# Storing a copy of the repo
40+
repo: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
41+
42+
node-version: 16
43+
44+
steps:
45+
- uses: actions/checkout@v2
46+
- uses: actions/setup-node@v2
47+
with:
48+
node-version: ${{ env.node-version }}
49+
50+
- name: Run install xvfb
51+
run: sudo apt-get install xvfb
52+
53+
- name: Run Environment Information
54+
run: |
55+
node --version
56+
npm --version
57+
58+
- name: Run npm install
59+
run: |
60+
npm i -g cordova@latest
61+
npm ci
62+
63+
- name: Run paramedic install
64+
if: ${{ endswith(env.repo, '/cordova-paramedic') != true }}
65+
run: npm i -g github:apache/cordova-paramedic
66+
67+
- name: Run paramedic tests
68+
env:
69+
test_config: 'browser.config.json'
70+
# Generally, this should automatically work for cordova-paramedic & plugins. If the path is unique, this can be manually changed.
71+
test_plugin_path: ${{ endswith(env.repo, '/cordova-paramedic') && './spec/testable-plugin/' || './' }}
72+
paramedic: ${{ endswith(env.repo, '/cordova-paramedic') && 'node main.js' || 'cordova-paramedic' }}
73+
run: xvfb-run --auto-servernum ${{ env.paramedic }} --config ./pr/local/${{ env.test_config }} --plugin ${{ env.test_plugin_path }}

.github/workflows/ios.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: iOS Testsuite
19+
20+
on:
21+
push:
22+
paths-ignore:
23+
- '**.md'
24+
- 'LICENSE'
25+
- '.eslint*'
26+
pull_request:
27+
paths-ignore:
28+
- '**.md'
29+
- 'LICENSE'
30+
- '.eslint*'
31+
32+
jobs:
33+
test:
34+
name: iOS ${{ matrix.versions.ios-version }} Test
35+
runs-on: macos-latest
36+
37+
# hoist configurations to top that are expected to be updated
38+
env:
39+
# Storing a copy of the repo
40+
repo: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
41+
42+
node-version: 16
43+
44+
# > Starting April 26, 2021, all iOS and iPadOS apps submitted to the App Store must be built with Xcode 12 and the iOS 14 SDK.
45+
# Because of Apple's requirement, listed above, We will only be using the latest Xcode release for testing.
46+
# To customize these options, add "xcode-version" to the strategy matrix with its overriding value.
47+
default_xcode-version: latest-stable
48+
49+
strategy:
50+
matrix:
51+
versions:
52+
- ios-version: 12.x
53+
- ios-version: 13.x
54+
- ios-version: 14.x
55+
56+
steps:
57+
- uses: actions/checkout@v2
58+
- uses: actions/setup-node@v2
59+
with:
60+
node-version: ${{ env.node-version }}
61+
- uses: maxim-lobanov/setup-xcode@881be567d30efed8fb3f12b5099d68c3fb72aa3d
62+
env:
63+
xcode-version: ${{ matrix.versions.xcode-version == '' && env.default_xcode-version || matrix.versions.xcode-version }}
64+
with:
65+
xcode-version: ${{ env.xcode-version }}
66+
67+
- name: Run Environment Information
68+
run: |
69+
node --version
70+
npm --version
71+
xcodebuild -version
72+
73+
- name: Run npm install
74+
run: |
75+
npm i -g cordova@latest ios-deploy@latest
76+
npm ci
77+
78+
- name: Run paramedic install
79+
if: ${{ endswith(env.repo, '/cordova-paramedic') != true }}
80+
run: npm i -g github:apache/cordova-paramedic
81+
82+
- name: Run paramedic tests
83+
env:
84+
test_config: 'ios-${{ matrix.versions.ios-version }}.config.json'
85+
# Generally, this should automatically work for cordova-paramedic & plugins. If the path is unique, this can be manually changed.
86+
test_plugin_path: ${{ endswith(env.repo, '/cordova-paramedic') && './spec/testable-plugin/' || './' }}
87+
paramedic: ${{ endswith(env.repo, '/cordova-paramedic') && 'node main.js' || 'cordova-paramedic' }}
88+
run: ${{ env.paramedic }} --config ./pr/local/${{ env.test_config }} --plugin ${{ env.test_plugin_path }}

.github/workflows/lint.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: Lint Test
19+
20+
on:
21+
push:
22+
paths:
23+
- '**.js'
24+
- '.eslint*'
25+
- '.github/workflow/lint.yml'
26+
pull_request:
27+
paths:
28+
- '**.js'
29+
- '.eslint*'
30+
- '.github/workflow/lint.yml'
31+
32+
jobs:
33+
test:
34+
name: Lint Test
35+
runs-on: ubuntu-latest
36+
env:
37+
node-version: 16
38+
39+
steps:
40+
- uses: actions/checkout@v2
41+
- uses: actions/setup-node@v2
42+
with:
43+
node-version: ${{ env.node-version }}
44+
45+
- name: Run Environment Information
46+
run: |
47+
node --version
48+
npm --version
49+
50+
- name: Run npm install
51+
run: |
52+
npm ci
53+
54+
- name: Run lint test
55+
run: |
56+
npm run lint

0 commit comments

Comments
 (0)