Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,39 @@
name: CI

env:
SDK_BRANCH_NAME: ${{ inputs.sdk_branch || github.head_ref || github.ref_name || 'main' }}
TEST_DATA_BRANCH_NAME: ${{ inputs.test_data_branch || 'main' }}

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌


workflow_call:
inputs:
test_data_branch:
type: string
description: The branch in sdk-test-data to target for testcase files
required: false
default: main
sdk_branch:
type: string
description: The branch of the SDK to test
required: false

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
repository: Eppo-exp/react-native-sdk
ref: ${{ env.SDK_BRANCH_NAME}}

- name: Setup Node.js
uses: actions/setup-node@v3
Expand All @@ -30,9 +51,19 @@ jobs:

test:
runs-on: ubuntu-latest

steps:
- name: Display Testing Details
run: |
echo "Running SDK Test using"
echo "Test Data: sdk-test-data@${TEST_DATA_BRANCH_NAME}"
echo "SDK Branch: php-sdk@${SDK_BRANCH_NAME}"

- name: Checkout
uses: actions/checkout@v3
with:
repository: Eppo-exp/react-native-sdk
ref: ${{ env.SDK_BRANCH_NAME}}

- name: Setup Node.js
uses: actions/setup-node@v3
Expand All @@ -46,13 +77,16 @@ jobs:
run: yarn install

- name: Run unit tests
run: yarn test --maxWorkers=2 --coverage
run: make test branchName=${{env.TEST_DATA_BRANCH_NAME}}

build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
repository: Eppo-exp/react-native-sdk
ref: ${{ env.SDK_BRANCH_NAME}}

- name: Setup Node.js
uses: actions/setup-node@v3
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ test-data:
cp ${gitDataDir}rac-experiments-v3.json ${testDataDir}
cp -r ${gitDataDir}assignment-v2 ${testDataDir}
rm -rf ${tempDir}

.PHONY: test
test: test-data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

yarn test --maxWorkers=2 --coverage
Loading