Skip to content

Commit

Permalink
feat: example updates & test configs (#18)
Browse files Browse the repository at this point in the history
Co-authored-by: Jakub Ziolkowski <[email protected]>
Co-authored-by: Dawid Krajewski <[email protected]>
  • Loading branch information
3 people authored Jun 18, 2024
1 parent 2c1f253 commit a595678
Show file tree
Hide file tree
Showing 77 changed files with 1,442 additions and 229 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/android_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
lfs: true

- name: Set up Node.js
if: ${{ !inputs.skip_build }}
Expand All @@ -39,7 +40,9 @@ jobs:

- name: Build dependencies
if: ${{ !inputs.skip_build }}
run: yarn build
run: yarn switch-env:dev
env:
PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }}

- name: Setup EAS
if: ${{ !inputs.skip_build }}
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ios_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
lfs: true

- name: Set up Node.js
if: ${{ !inputs.skip_build }}
Expand Down Expand Up @@ -48,7 +49,9 @@ jobs:

- name: Build dependencies
if: ${{ !inputs.skip_build }}
run: yarn build
run: yarn switch-env:dev
env:
PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }}

- name: Setup EAS
if: ${{ !inputs.skip_build }}
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ jobs:
run: npx lerna version $NEW_VERSION_NUMBER --yes --no-git-tag-version --no-push

- name: Build packages
run: yarn build
run: yarn switch-env:dev
env:
PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }}

- name: Commit and push updated files
uses: EndBug/add-and-commit@v7
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/run_sherlo_async.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,16 @@ jobs:
run: yarn

- name: Build dependencies
run: yarn build
run: yarn switch-env:dev
env:
PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }}

- name: Run Sherlo Action in async mode
id: sherlo_action # This ID is used to reference the output
uses: ./.
with:
projectRoot: examples/expo-example
config: ../../configs/async.storybook.json
async: true
env:
SHERLO_TOKEN: ${{ secrets.SHERLO_TOKEN_ASYNC }}
Expand Down Expand Up @@ -82,7 +85,9 @@ jobs:
run: yarn

- name: Build dependencies
run: yarn build
run: yarn switch-env:dev
env:
PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }}

- name: Download Android Artifact
uses: actions/download-artifact@v2
Expand All @@ -94,6 +99,7 @@ jobs:
uses: ./.
with:
projectRoot: examples/expo-example
config: ../../configs/async.storybook.json
android: builds/preview/android.apk
asyncBuildIndex: ${{ needs.run_sherlo_async.outputs.buildIndex }}
env:
Expand Down Expand Up @@ -127,7 +133,9 @@ jobs:
run: yarn

- name: Build dependencies
run: yarn build
run: yarn switch-env:dev
env:
PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }}

- name: Download iOS Artifact
uses: actions/download-artifact@v2
Expand All @@ -139,6 +147,7 @@ jobs:
uses: ./.
with:
projectRoot: examples/expo-example
config: ../../configs/async.storybook.json
ios: builds/preview/ios.tar.gz
asyncBuildIndex: ${{ needs.run_sherlo_async.outputs.buildIndex }}
env:
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/run_sherlo_eas_hooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Run Sherlo with EAS hooks

on:
pull_request:
branches: [ dev ]
types: [ labeled ]
branches: [dev]
types: [labeled]
workflow_call:
workflow_dispatch:

Expand All @@ -21,7 +21,9 @@ jobs:
run: yarn

- name: Build dependencies
run: yarn build
run: yarn switch-env:dev
env:
PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }}

- name: Setup EAS
uses: expo/expo-github-action@v8
Expand All @@ -35,6 +37,7 @@ jobs:
uses: ./.
with:
projectRoot: examples/expo-example
config: ../../configs/eas.preview.json
async: true
env:
SHERLO_TOKEN: ${{ secrets.SHERLO_TOKEN_EAS }}
Expand Down
21 changes: 18 additions & 3 deletions .github/workflows/run_sherlo_sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ on:
required: false
default: false
type: boolean
test_all_nodes:
description: 'Test all Node versions'
required: false
default: false
type: boolean

jobs:
## Android
Expand Down Expand Up @@ -49,6 +54,9 @@ jobs:
name: Run Sherlo in sync mode
runs-on: ubuntu-latest
needs: [android_preview_build, ios_preview_build]
strategy:
matrix:
node-version: ${{ fromJson(github.event.inputs.test_all_nodes && '["18.18.0"]' || '["22.3.0", "21.7.3", "20.14.0", "19.9.0", "18.20.3", "17.9.1", "16.20.2", "15.14.0", "14.21.3", "13.14.0", "12.22.12", "11.15.0", "10.24.1"]') }}
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -57,13 +65,15 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18.18.0'
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: yarn

- name: Build dependencies
run: yarn build
run: yarn switch-env:dev
env:
PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }}

- name: Download Android Artifact
uses: actions/download-artifact@v2
Expand All @@ -77,11 +87,16 @@ jobs:
name: ios
path: examples/expo-example/builds/preview

- name: Echo Directory Path
run: |
echo "Directory Path: examples/expo-example/builds/preview"
ls -la examples/expo-example/builds/preview
- name: Run Sherlo Action
uses: ./.
with:
ios: examples/expo-example/builds/preview/ios.tar.gz
android: examples/expo-example/builds/preview/android.apk
config: examples/expo-example/sherlo.config.json
config: configs/sync.preview.json
env:
SHERLO_TOKEN: ${{ secrets.SHERLO_TOKEN_SYNC }}
89 changes: 89 additions & 0 deletions configs/async.storybook.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"android": "builds/storybook/android.apk",
"ios": "builds/storybook/ios.tar.gz",
"include": ["components/screens/"],
"devices": [
{
"id": "pixel.tablet",
"osVersion": "13",
"osLanguage": "fr_FR",
"osTheme": "dark"
},
{
"id": "ipad.9.gen",
"osVersion": "15"
},
{
"id": "ipad.9.gen",
"osVersion": "16"
},
{
"id": "ipad.9.gen",
"osVersion": "17"
},
{
"id": "ipad.10.gen",
"osVersion": "16"
},
{
"id": "ipad.10.gen",
"osVersion": "17"
},
{
"id": "ipad.air.5.gen",
"osVersion": "15"
},
{
"id": "ipad.air.5.gen",
"osVersion": "16"
},
{
"id": "ipad.air.5.gen",
"osVersion": "17"
},
{
"id": "ipad.air.11.m2",
"osVersion": "17"
},
{
"id": "ipad.air.13.m2",
"osVersion": "17"
},
{
"id": "ipad.mini.6.gen",
"osVersion": "15"
},
{
"id": "ipad.mini.6.gen",
"osVersion": "16"
},
{
"id": "ipad.mini.6.gen",
"osVersion": "17"
},
{
"id": "ipad.pro.11.4.gen",
"osVersion": "16"
},
{
"id": "ipad.pro.11.4.gen",
"osVersion": "17"
},
{
"id": "ipad.pro.11.m4",
"osVersion": "17"
},
{
"id": "ipad.pro.12.9.6.gen",
"osVersion": "16"
},
{
"id": "ipad.pro.12.9.6.gen",
"osVersion": "17"
},
{
"id": "ipad.pro.13.m4",
"osVersion": "17"
}
]
}
43 changes: 43 additions & 0 deletions configs/demo.preview.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"android": "builds/preview/android.apk",
"ios": "builds/preview/ios.tar.gz",
"include": ["components/screens/"],
"devices": [
{
"id": "pixel.4a",
"osVersion": "13",
"osLanguage": "en_US",
"osTheme": "light"
},
{
"id": "pixel.7.pro",
"osVersion": "13",
"osLanguage": "en_US",
"osTheme": "light"
},
{
"id": "pixel.tablet",
"osVersion": "13",
"osLanguage": "fr_FR",
"osTheme": "dark"
},
{
"id": "iphone.13.mini",
"osVersion": "15",
"osLanguage": "en_US",
"osTheme": "light"
},
{
"id": "iphone.15.pro",
"osVersion": "17",
"osLanguage": "en_US",
"osTheme": "light"
},
{
"id": "ipad.pro.13.m4",
"osVersion": "17",
"osLanguage": "en_US",
"osTheme": "light"
}
]
}
Loading

0 comments on commit a595678

Please sign in to comment.