Skip to content

Commit

Permalink
Cordova build actions (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
kober32 authored Sep 10, 2024
1 parent 1cc31cf commit 718e2ef
Show file tree
Hide file tree
Showing 22 changed files with 1,050 additions and 900 deletions.
21 changes: 21 additions & 0 deletions .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Prepare PowerAuth JS environment

inputs:
env-file:
description: Contents of the testapp/.env file
required: false
default: "empty"

runs:
using: composite
steps:
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install dependencies
shell: bash
run: npm i
- name: Set .env file
shell: bash
run: echo -e "${{ inputs.env-file }}" > testapp/.env
20 changes: 20 additions & 0 deletions .github/workflows/build-library.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Build

on:
push:
branches:
- develop
- release/*
pull_request:

jobs:
build-library:
name: Build and Pack the Library
runs-on: macos-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Prepare environment
uses: ./.github/actions/prepare
- name: Library build
run: npm run build
74 changes: 0 additions & 74 deletions .github/workflows/build.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/publish.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/test-ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: iOS Tests

on:
push:
branches:
- develop
- release/*
pull_request:

jobs:
test-cordova:
name: Test Cordova iOS
runs-on: macos-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Prepare environment
uses: ./.github/actions/prepare
with:
env-file: ${{ secrets.ENV_TEST_FILE }}
- name: Run Cordova iOS Tests
run: npm run buildAndRunCordovaIosTests
test-react-native:
name: Test React Native iOS
runs-on: macos-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Prepare environment
uses: ./.github/actions/prepare
with:
env-file: ${{ secrets.ENV_TEST_FILE }}
- name: Run React-Native iOS Tests
run: npm run buildAndRunReactIosTests
16 changes: 16 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
//
// Copyright 2024 Wultra s.r.o.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

// Dependencies
const gulp = require("gulp"); // gulp itself
const ts = require("gulp-typescript"); // to be able to compiles typescript
Expand Down
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"types": "lib/index.d.ts",
"source": "src/index",
"scripts": {
"build": "node node_modules/gulp/bin/gulp.js"
"build": "node node_modules/gulp/bin/gulp.js",
"buildAndRunCordovaIosTests": "npm run build && pushd testapp-cordova && npm run reinstallPlugin && npm run build && npm run ios && popd && node test-listener.js",
"buildAndRunReactIosTests": "npm run build && pushd testapp && npm run reinstallPlugin && npx pod-install && (npm run start & npm run ios) && popd && node test-listener.js"
},
"files": [
"README.md",
Expand Down Expand Up @@ -56,6 +58,7 @@
"gulp-strip-import-export": "^1.0.0",
"gulp-typescript": "^6.0.0-alpha.1",
"lodash": "^4.17.21",
"pod-install": "^0.2.2",
"react-native": "^0.73.4",
"rimraf": "^6.0.1"
}
Expand Down
135 changes: 0 additions & 135 deletions scripts/build-library.sh

This file was deleted.

Loading

0 comments on commit 718e2ef

Please sign in to comment.