Skip to content

Commit

Permalink
[Frontend][Version][Update] lexicon version v2.2.0 (#72)
Browse files Browse the repository at this point in the history
* lexicon version 2.2.0

* disable detox test
  • Loading branch information
starjustice committed Aug 13, 2024
1 parent 3bc29a1 commit 03f2ca0
Show file tree
Hide file tree
Showing 397 changed files with 18,272 additions and 957 deletions.
33 changes: 15 additions & 18 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Bug report
name: Bug report (lexiconhq)
about: Create a report to help us improve
title: ''
labels: ''
Expand All @@ -17,9 +17,9 @@ assignees: ''
---

### Describe the bug
A clear and concise description of what the bug is.
_A clear and concise description of what the bug is._

### *REQUIRED:* Include the contents of `api/.env` and `frontend/.env`
### *REQUIRED:* Include the contents of `api/.env` and `frontend/Config.ts`
_If you are manually overriding any environment variables when running the package scripts, include those as well._

**api/.env**
Expand All @@ -33,22 +33,19 @@ _If you are manually overriding any environment variables when running the packa
```

### _REQUIRED:_ answer the following questions:
- If this is related to your mobile app:
- Are you running it through Expo, or did you build it?
- Is it running on your mobile device or on a simulator?
- _If this is related to your mobile app:_
- _Are you running it through Expo, or did you build it?_
- _Is it running on your mobile device or on a simulator?_

### To Reproduce
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
_Steps to reproduce the behavior_
***Please use a numbered list**

### Expected behavior
A clear and concise description of what you expected to happen.
_A clear and concise description of what you expected to happen._

### Screenshots
If applicable, add screenshots to help explain your problem.
_If applicable, add screenshots to help explain your problem._

### Environments

Expand All @@ -64,13 +61,13 @@ If applicable, add screenshots to help explain your problem.
- Version [e.g. 22]

#### GraphQL API (please complete the following information):
Please indicate where the Prose GraphQL API is running.
_Please indicate where the Prose GraphQL API is running._

Are you only running it locally on your development machine?
- _Are you only running it locally on your development machine?_

Have you deployed it somewhere? If so, what domain or IP address did you deploy it at?
- _Have you deployed it somewhere? If so, what domain or IP address did you deploy it at?_

How specifically did you configure the mobile app to connect to the API?
- _How specifically did you configure the mobile app to connect to the API?_

### Additional context
Add any other context about the problem here.
_Add any other context about the problem here._
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/new_feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: New Feature
about: A new Lexicon feature
title: ''
labels: ''
assignees: ''

---

## Description

## Acceptance Criteria
- [ ]

## Guidance
18 changes: 18 additions & 0 deletions .github/workflows/delete-build-jet-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Manually Delete BuildJet Cache

on:
workflow_dispatch:
inputs:
cache_key:
description: 'BuildJet Cache Key to Delete'
required: true
type: string
jobs:
manually-delete-buildjet-cache:
runs-on: buildjet-2vcpu-ubuntu-2204
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: buildjet/cache-delete@v1
with:
cache_key: ${{ inputs.cache_key }}
111 changes: 111 additions & 0 deletions .github/workflows/e2e-test-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: E2E test android

on: workflow_call

jobs:
e2e-test-android:
runs-on: ${{matrix.runs-on}}
name: Android Test ${{matrix.runs-on}}
strategy:
fail-fast: false
matrix:
runs-on: [buildjet-4vcpu-ubuntu-2204]

steps:
- name: Checkout
uses: actions/checkout@v4

- uses: buildjet/setup-node@v4
with:
node-version: '20.x'

- name: Configure JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- uses: buildjet/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn

- name: Generate files
run: yarn generate

- name: Cache Detox build
id: cache-detox-build
uses: buildjet/cache@v4
with:
path: frontend/android
key: ${{ runner.os }}-detox-build

- name: Expo prebuild android and build detox
if: steps.cache-detox-build.outputs.cache-hit != 'true'
run: |
cd frontend
npx expo prebuild --platform android
yarn tests:android:build
- name: Setup Detox
run: |
cd frontend
npm install -g detox-cli
detox clean-framework-cache && yarn detox build-framework-cache
- name: Gradle cache
uses: gradle/gradle-build-action@v2

- name: AVD cache
uses: buildjet/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-28

- name: create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 28
target: google_apis
arch: x86
profile: pixel_5
avd-name: Pixel_5_API_28
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."

- name: Run Test
timeout-minutes: 25
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 28
target: google_apis
arch: x86
profile: pixel_5
avd-name: Pixel_5_API_28
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: bash ${{ github.workspace }}/frontend/scripts/android-E2E.sh

- name: upload artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: android-artifacts-${{matrix.runs-on}}
path: frontend/artifacts/
46 changes: 23 additions & 23 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,33 @@ on:
pull_request:
branches: [master]

env:
LIST_REPO_E2E_TEST: ('lexicon','lexicon-kodefox') # list of repo name which want run e2e test

jobs:
build:
# get-env job is run to get env using output because we cannot use env context outside steps if: env.LIST_REPO_E2E_TEST
# https://github.com/actions/runner/issues/2372#issuecomment-1518528105

get-env:
runs-on: ubuntu-latest
outputs:
LIST_REPO: ${{ env.LIST_REPO_E2E_TEST }}
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: '16.x'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- run: echo "null"

- uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
path-filters:
needs: [get-env]
if: contains(needs.get-env.outputs.LIST_REPO,github.event.repository.name)
uses: ./.github/workflows/path-filters.yml

- name: Install dependencies
run: yarn
test:
uses: ./.github/workflows/test.yml

- name: Generate files
run: yarn generate
# Disable Detox tests because they require a connection with a Build Jet account.
# To enable these tests, ensure your repository is connected to Build Jet: https://buildjet.com/for-github-actions

- name: Run tests
run: yarn test
# e2e-test:
# needs: [path-filters, test]
# if: needs.path-filters.outputs.frontendSrc-changes == 'true' && contains(needs.get-env.outputs.LIST_REPO,github.event.repository.name)
# uses: ./.github/workflows/e2e-test-android.yml
# secrets: inherit
54 changes: 54 additions & 0 deletions .github/workflows/path-filters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Path Filtering

on:
workflow_call:
outputs:
frontend-changes:
description: 'this is lexicon app changes status'
value: ${{ jobs.path-filters.outputs.frontend-changes }}
frontendSrc-changes:
description: 'this is lexicon app src only status'
value: ${{ jobs.path-filters.outputs.frontendSrc-changes }}
backend-changes:
description: 'this is Backend Prose changes status'
value: ${{ jobs.path-filters.outputs.backend-changes }}

jobs:
path-filters:
runs-on: ubuntu-latest
outputs:
frontend-changes: ${{ steps.filter-frontend.outputs.isUpdated }}
frontendSrc-changes: ${{ steps.filter-frontendSrc.outputs.isUpdated }}
backend-changes: ${{ steps.filter-backend.outputs.isUpdated }}

steps:
- uses: actions/checkout@v4

- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
backend:
- 'api/**'
frontend:
- 'frontend/**'
frontendSrc:
- 'frontend/src/**'
# run only if 'backend' files were changed
- name: Output filter Backend Prose
id: filter-backend
if: steps.filter.outputs.backend == 'true'
run: echo "isUpdated=true" >> $GITHUB_OUTPUT

# run only if 'frontend' files were changed
- name: Output filter Lexicon
id: filter-frontend
if: steps.filter.outputs.frontend == 'true'
run: echo "isUpdated=true" >> $GITHUB_OUTPUT

# run only if 'frontend scene and component' files were changed
- name: Output filter Lexicon src
id: filter-frontendSrc
if: steps.filter.outputs.frontendSrc == 'true'
run: echo "isUpdated=true" >> $GITHUB_OUTPUT
34 changes: 34 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: test

on: workflow_call

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '20.x'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn

- name: Generate files
run: yarn generate

- name: Run tests
run: yarn test
2 changes: 1 addition & 1 deletion api/deploy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM keymetrics/pm2:16-alpine
FROM keymetrics/pm2:18-alpine

WORKDIR /app

Expand Down
1 change: 1 addition & 0 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"nexus": "^1.4.0-next.11",
"querystring": "^0.2.0",
"set-cookie-parser": "^2.5.1",
"sharp": "^0.32.6",
"snakecase-keys": "^3.2.0",
"tough-cookie": "^4.1.3",
"winston": "^3.10.0",
Expand Down
12 changes: 0 additions & 12 deletions api/src/__tests__/cookiesStringify.ts

This file was deleted.

Loading

0 comments on commit 03f2ca0

Please sign in to comment.