From 074602e7cfc85fe85f8b20a0a366661ac6616bb5 Mon Sep 17 00:00:00 2001 From: Jan Kobersky Date: Mon, 9 Sep 2024 15:39:48 +0200 Subject: [PATCH] Fixed prepare action --- .github/actions/prepare/action.yml | 12 +++++++++--- .github/workflows/build-library.yml | 10 +++------- .github/workflows/test-ios.yml | 4 ++++ 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/actions/prepare/action.yml b/.github/actions/prepare/action.yml index 686d957..c4e7f08 100644 --- a/.github/actions/prepare/action.yml +++ b/.github/actions/prepare/action.yml @@ -1,5 +1,11 @@ name: Prepare PowerAuth JS environment +inputs: + env-file: + description: Contents of the testapp/.env file + required: false + default: "empty" + runs: using: composite steps: @@ -8,8 +14,8 @@ runs: with: node-version: 22 - name: Install dependencies + shell: bash run: npm i - name: Set .env file - env: - ENV_TEST_FILE: ${{ secrets.ENV_TEST_FILE }} - run: echo -e "$ENV_TEST_FILE" > testapp/.env \ No newline at end of file + shell: bash + run: echo -e "${{ inputs.env-file }}" > testapp/.env \ No newline at end of file diff --git a/.github/workflows/build-library.yml b/.github/workflows/build-library.yml index bbefcf5..f17d962 100644 --- a/.github/workflows/build-library.yml +++ b/.github/workflows/build-library.yml @@ -14,11 +14,7 @@ jobs: steps: - name: Checkout the repo uses: actions/checkout@v4 - - name: Use Node.js 22 - uses: actions/setup-node@v4 - with: - node-version: 22 - - name: Install dependencies - run: npm i - - name: run library build + - name: Prepare environment + uses: ./.github/actions/prepare + - name: Library build run: npm run build \ No newline at end of file diff --git a/.github/workflows/test-ios.yml b/.github/workflows/test-ios.yml index 9a412d3..97ec002 100644 --- a/.github/workflows/test-ios.yml +++ b/.github/workflows/test-ios.yml @@ -16,6 +16,8 @@ jobs: 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: @@ -26,5 +28,7 @@ jobs: 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 \ No newline at end of file