-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
4,261 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.github/ | ||
docs/ | ||
coverage/ | ||
node_modules/ | ||
sample/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
root: true | ||
extends: | ||
- "@cordova/eslint-config/node" | ||
|
||
plugins: | ||
- es | ||
|
||
parserOptions: | ||
ecmaFeatures: | ||
impliedStrict: true | ||
|
||
overrides: | ||
- files: | ||
- tests/specs/**/*.js | ||
extends: | ||
- "@cordova/eslint-config/node-tests" | ||
rules: | ||
quotes: ["error", "double"] | ||
|
||
- files: | ||
- www/**/*.js | ||
extends: | ||
# ES5 | ||
- "plugin:es/no-new-in-es2015" | ||
- "@cordova/eslint-config/browser" | ||
rules: | ||
quotes: ["error", "double"] | ||
|
||
rules: | ||
quotes: ["error", "double"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,277 @@ | ||
name: Node CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
darwin: | ||
name: NodeJS ${{ matrix.node-version }} on ${{ matrix.os }}, cordova@${{ matrix.cordova.v }}, cordova-ios@${{ matrix.cordova.ios.v }}, cordova-android@${{ matrix.cordova.android.v }} (Min SDK ${{ matrix.cordova.android.minSdk }}) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
node-version: | ||
- 10.x | ||
- 14.x | ||
os: | ||
- macos-latest | ||
cordova: | ||
- v: '8.0.0' | ||
ios: | ||
v: '5.1.1' | ||
android: | ||
v: '7.1.4' | ||
minSdk: 19 | ||
- v: '9.0.0' | ||
ios: | ||
v: '6.2.0' | ||
android: | ||
v: '9.0.0' | ||
minSdk: 22 | ||
- v: '10.0.0' | ||
ios: | ||
v: '6.2.0' | ||
android: | ||
v: '10.0.0' | ||
minSdk: 22 | ||
exclude: | ||
# NodeJS 10 deprecated in cordova-android@10 | ||
- node-version: 10.x | ||
cordova: | ||
android: | ||
v: '10.0.0' | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Get npm cache directory | ||
id: npm-cache-dir | ||
run: | | ||
echo "::set-output name=dir::$(npm config get cache)" | ||
- name: Cache npm | ||
uses: actions/cache@v2 | ||
id: npm-cache | ||
with: | ||
path: ${{ steps.npm-cache-dir.outputs.dir }} | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: npm install and test | ||
run: npm cit | ||
env: | ||
CI: true | ||
|
||
- name: Install XCode latest-stable | ||
uses: maxim-lobanov/setup-xcode@v1 | ||
with: | ||
xcode-version: latest-stable | ||
|
||
- name: Install Java 8 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: adopt | ||
java-version: 8 | ||
|
||
- name: npm install cordova@${{ matrix.cordova.v }} | ||
run: npm install cordova@${{ matrix.cordova.v }} -g | ||
|
||
- name: Cache .gradle | ||
uses: burrunan/gradle-cache-action@v1 | ||
with: | ||
job-id: jdk8 | ||
gradle-version: wrapper | ||
|
||
- name: Checkout clean plugin | ||
uses: actions/checkout@v2 | ||
with: | ||
path: plugin | ||
|
||
- name: cordova create | ||
run: cordova create testApp com.skwas.testApp testApp | ||
|
||
- name: Minimum Android SDK ${{ matrix.cordova.android.minSdk }} | ||
run: npm run cordova-preference -- ./testApp android-minSdkVersion ${{ matrix.cordova.android.minSdk }} | ||
|
||
# cordova-android@8 requires shim to enable AndroidX. | ||
- name: Enable AndroidX via shim 'cordova-plugin-androidx' | ||
if: matrix.cordova.android.v == '8.0.0' | ||
working-directory: ./testApp | ||
run: cordova plugin add cordova-plugin-androidx | ||
|
||
# cordova-android@9 requires opt-in to AndroidX via config preference. | ||
- name: Enable AndroidX | ||
if: matrix.cordova.android.v == '9.0.0' | ||
run: | | ||
npm run cordova-preference -- ./testApp AndroidXEnabled true | ||
- name: cordova plugin add | ||
working-directory: ./testApp | ||
run: cordova plugin add ${{ github.workspace }}/plugin | ||
|
||
- name: cordova platform add android@${{ matrix.cordova.android.v }} | ||
working-directory: ./testApp | ||
run: cordova platform add android@${{ matrix.cordova.android.v }} | ||
|
||
# Android SDK Build tools throws error: Build-tool 32.0.0 is missing DX | ||
# https://stackoverflow.com/questions/68397703/installed-build-tools-revision-31-0-0-is-corrupted-remove-and-install-again-usi | ||
- name: Patch Build Tools | ||
if: matrix.cordova.android.v != '8.0.0' | ||
run: | | ||
cd $ANDROID_SDK_ROOT/build-tools/32.0.0 | ||
mv d8 dx | ||
cd lib | ||
mv d8.jar dx.jar | ||
- name: cordova platform add ios@${{ matrix.cordova.ios.v }} | ||
working-directory: ./testApp | ||
run: cordova platform add ios@${{ matrix.cordova.ios.v }} | ||
|
||
- name: cordova build | ||
working-directory: ./testApp | ||
run: cordova build --no-telemetry | ||
|
||
non-darwin: | ||
name: NodeJS ${{ matrix.node-version }} on ${{ matrix.os }}, cordova@${{ matrix.cordova.v }}, cordova-android@${{ matrix.cordova.android.v }} (Min SDK ${{ matrix.cordova.android.minSdk }}) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
node-version: | ||
- 10.x | ||
- 14.x | ||
os: | ||
- ubuntu-latest | ||
- windows-latest | ||
cordova: | ||
- v: '8.0.0' | ||
android: | ||
v: '7.1.4' | ||
minSdk: 19 | ||
- v: '9.0.0' | ||
android: | ||
v: '8.0.0' | ||
minSdk: 19 | ||
- v: '9.0.0' | ||
android: | ||
v: '9.0.0' | ||
minSdk: 22 | ||
- v: '9.0.0' | ||
android: | ||
v: '10.0.0' | ||
minSdk: 22 | ||
- v: '10.0.0' | ||
android: | ||
v: '10.0.0' | ||
minSdk: 22 | ||
exclude: | ||
# NodeJS 10 deprecated in cordova-android@10 | ||
- node-version: 10.x | ||
cordova: | ||
android: | ||
v: '10.0.0' | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Get npm cache directory | ||
id: npm-cache-dir | ||
run: | | ||
echo "::set-output name=dir::$(npm config get cache)" | ||
- name: Cache npm | ||
uses: actions/cache@v2 | ||
id: npm-cache | ||
with: | ||
path: ${{ steps.npm-cache-dir.outputs.dir }} | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: npm install and test | ||
run: npm cit | ||
env: | ||
CI: true | ||
|
||
- name: Install Java 8 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: adopt | ||
java-version: 8 | ||
|
||
- name: npm install cordova@${{ matrix.cordova.v }} | ||
run: npm install cordova@${{ matrix.cordova.v }} -g | ||
|
||
- name: Cache .gradle | ||
uses: burrunan/gradle-cache-action@v1 | ||
with: | ||
job-id: jdk8 | ||
gradle-version: wrapper | ||
|
||
- name: Checkout clean plugin | ||
uses: actions/checkout@v2 | ||
with: | ||
path: plugin | ||
|
||
- name: cordova create | ||
run: cordova create testApp com.skwas.testApp testApp | ||
|
||
- name: Minimum Android SDK ${{ matrix.cordova.android.minSdk }} | ||
run: npm run cordova-preference -- ./testApp android-minSdkVersion ${{ matrix.cordova.android.minSdk }} | ||
|
||
# cordova-android@8 requires shim to enable AndroidX. | ||
- name: Enable AndroidX via shim 'cordova-plugin-androidx' | ||
if: matrix.cordova.android.v == '8.0.0' | ||
working-directory: ./testApp | ||
run: cordova plugin add cordova-plugin-androidx | ||
|
||
# cordova-android@9 requires opt-in to AndroidX via config preference. | ||
- name: Enable AndroidX | ||
if: matrix.cordova.android.v == '9.0.0' | ||
run: | | ||
npm run cordova-preference -- ./testApp AndroidXEnabled true | ||
- name: cordova plugin add | ||
working-directory: ./testApp | ||
run: cordova plugin add ${{ github.workspace }}/plugin | ||
|
||
- name: cordova platform add android@${{ matrix.cordova.android.v }} | ||
working-directory: ./testApp | ||
run: cordova platform add android@${{ matrix.cordova.android.v }} | ||
|
||
# Android SDK Build tools throws error: Build-tool 32.0.0 is missing DX | ||
# https://stackoverflow.com/questions/68397703/installed-build-tools-revision-31-0-0-is-corrupted-remove-and-install-again-usi | ||
- name: Patch Build Tools (Linux) | ||
if: (matrix.cordova.android.v == '9.0.0' || matrix.cordova.android.v == '10.0.0') && matrix.os == 'ubuntu-latest' | ||
run: | | ||
cd $ANDROID_SDK_ROOT/build-tools/32.0.0 | ||
mv d8 dx | ||
mv ./lib/d8.jar ./lib/dx.jar | ||
- name: Patch Build Tools (Windows) | ||
if: (matrix.cordova.android.v == '9.0.0' || matrix.cordova.android.v == '10.0.0') && matrix.os == 'windows-latest' | ||
env: | ||
BUILD_TOOLS: build-tools\32.0.0 | ||
run: | | ||
ren $env:ANDROID_SDK_ROOT\$env:BUILD_TOOLS\d8.bat $env:ANDROID_SDK_ROOT\$env:BUILD_TOOLS\dx.bat | ||
ren $env:ANDROID_SDK_ROOT\$env:BUILD_TOOLS\lib\d8.jar $env:ANDROID_SDK_ROOT\$env:BUILD_TOOLS\lib\dx.jar | ||
- name: cordova build | ||
working-directory: ./testApp | ||
run: cordova build --no-telemetry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Publish | ||
|
||
on: | ||
release: | ||
types: | ||
- created | ||
|
||
jobs: | ||
publish: | ||
name: Publish NPM release | ||
runs-on: ubuntu-latest | ||
environment: Production | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install NodeJS | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14.x | ||
|
||
- name: npm install and test | ||
run: npm cit | ||
env: | ||
CI: true | ||
|
||
- name: prepare publish | ||
run: echo //registry.npmjs.org/:_authToken=$\{NPM_TOKEN\} > .npmrc | ||
|
||
- name: npm publish | ||
run: npm publish | ||
env: | ||
CI: true | ||
NPM_TOKEN: ${{ secrets.NPM_PUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
node_modules | ||
Thumbs.db | ||
sample/dev* | ||
sample/dev* | ||
coverage | ||
.nyc_output |
Oops, something went wrong.