Skip to content

Commit

Permalink
chore: make CI green (#527)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: only Android API level >=21 (Android 5) and iOS >= 11 are supported��

apart from green CI, this fixed at least one bug as well
  • Loading branch information
vonovak authored Nov 22, 2021
1 parent 244978e commit da12e92
Show file tree
Hide file tree
Showing 49 changed files with 3,319 additions and 2,905 deletions.
103 changes: 54 additions & 49 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,24 @@
version: 2.1

orbs:
rn: react-native-community/[email protected]
rn: react-native-community/[email protected]
android: circleci/[email protected]

# - rn/yarn_install
# fails with Error untarring cache: Error extracting tarball /var/folders/bq/mjrgbpkx5h1g_b22fpv0tlzc0000gn/T/cache376822577 : tmp/yarn/: Cannot extract through symlink tmp/yarn tmp/yarn/v6/: Cannot extract through symlink tmp/yarn/v6 tmp/yarn/v6/.tmp/: Cannot extract through symlink tmp/yarn/v6/.tmp tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity/: Cannot extract through symlink tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity/node_modules/: Cannot extract through symlink tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity/node_modules tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity/node_modules/@babel/: Cannot extract through symlink tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity/node_modules/@babel tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity/node_modules/@babel/code-frame/: Cannot extract: exit status 1
# that is why we use yarn install --frozen-lockfile but that is SLOW! help us to fix this!

jobs:
checkout_code:
analyse_js:
executor:
name: rn/linux_js
node_version: '12.10.0'
node_version: '14.17.0'
steps:
- checkout
- persist_to_workspace:
paths: .
root: .
analyse_js:
executor: rn/linux_js
steps:
- attach_workspace:
at: .
# - rn/yarn_install
# fails with Error untarring cache: Error extracting tarball /var/folders/bq/mjrgbpkx5h1g_b22fpv0tlzc0000gn/T/cache376822577 : tmp/yarn/: Cannot extract through symlink tmp/yarn tmp/yarn/v6/: Cannot extract through symlink tmp/yarn/v6 tmp/yarn/v6/.tmp/: Cannot extract through symlink tmp/yarn/v6/.tmp tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity/: Cannot extract through symlink tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity/node_modules/: Cannot extract through symlink tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity/node_modules tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity/node_modules/@babel/: Cannot extract through symlink tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity/node_modules/@babel tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity/node_modules/@babel/code-frame/: Cannot extract: exit status 1
- run:
command: yarn install --frozen-lockfile --ignore-engines
command: yarn install --frozen-lockfile
name: yarn install
- run:
command: yarn lint
Expand All @@ -36,84 +29,96 @@ jobs:
- run:
command: yarn test
name: Jest

e2e_release_ios:
executor:
name: rn/macos
xcode_version: '11.4.0'
xcode_version: '13.1.0'
steps:
- attach_workspace:
at: .
- rn/setup_macos_executor:
node_version: '12.10.0'
- checkout
- run:
name: install applesimutils
command: |
HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null
HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils >/dev/null
- rn/ios_simulator_start:
device: 'iPhone 11'
# - rn/yarn_install
- run:
command: yarn install --frozen-lockfile --ignore-engines
command: yarn install --frozen-lockfile
name: yarn install
- rn/pod_install:
pod_install_directory: 'example/ios'
- run:
command: curl https://raw.githubusercontent.com/facebook/react-native/6334ac35ac3cbc2c84b2d46d46ec118bf9bf714d/scripts/find-node.sh > node_modules/react-native/scripts/find-node.sh
name: fix issue with nvm # will be fixed in RN 67 (https://github.com/react-native-community/upgrade-support/issues/138)
- run:
command: yarn detox:ios:build:release
name: build for detox
name: build app for e2e tests
- run:
command: yarn detox:ios:test:release
name: test detox
name: run e2e tests
- store_artifacts:
path: ./artifacts

e2e_release_android:
# we need to use mac to run emulator with acceleration
# see https://support.circleci.com/hc/en-us/articles/360000028928-Testing-with-Android-emulator-on-CircleCI-2-0
executor:
name: rn/macos
xcode_version: '11.4.0'
name: android/android-machine
resource-class: large
steps:
- attach_workspace:
at: .
- rn/setup_macos_executor:
node_version: '12.10.0'
# - rn/yarn_install
- checkout
- run:
command: yarn install --frozen-lockfile --ignore-engines
name: change default node version
command: |
nvm install v15.11.0
nvm alias default v15.11.0
echo 'export PATH=/opt/circleci/.nvm/versions/node/v15.11.0/bin:$PATH' >> $BASH_ENV
- android/create-avd:
avd-name: TestingAVD
system-image: system-images;android-29;default;x86
install: true
- android/start-emulator:
avd-name: TestingAVD
no-window: true
restore-gradle-cache-prefix: v1a
post-emulator-launch-assemble-command: "pwd"
- android/disable-animations
- run:
command: npm install --global yarn
name: install yarn
- run:
command: yarn install --frozen-lockfile
name: yarn install
- rn/android_emulator_start:
logcat_grep: 'com.reactcommunity.rndatetimepicker'
- run:
command: yarn detox:android:build:release
name: build for detox
name: build app for e2e tests
- run:
command: yarn detox:android:test:release
name: test detox
name: run e2e tests
- store_artifacts:
path: ./artifacts

publish:
executor: rn/linux_js
executor:
name: rn/linux_js
node_version: '14.17.0'
steps:
- attach_workspace:
at: .
- checkout
# - rn/yarn_install
# fails with Error untarring cache: Error extracting tarball /var/folders/bq/mjrgbpkx5h1g_b22fpv0tlzc0000gn/T/cache376822577 : tmp/yarn/: Cannot extract through symlink tmp/yarn tmp/yarn/v6/: Cannot extract through symlink tmp/yarn/v6 tmp/yarn/v6/.tmp/: Cannot extract through symlink tmp/yarn/v6/.tmp tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity/: Cannot extract through symlink tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity/node_modules/: Cannot extract through symlink tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity/node_modules tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity/node_modules/@babel/: Cannot extract through symlink tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity/node_modules/@babel tmp/yarn/v6/npm-@babel-code-frame-7.8.3-33e25903d7481181534e12ec0a25f16b6fcf419e-integrity/node_modules/@babel/code-frame/: Cannot extract: exit status 1
- run:
command: yarn install --frozen-lockfile --ignore-engines
command: yarn install --frozen-lockfile
name: yarn install
- run:
command: npx semantic-release
name: Publish to NPM


workflows:
test:
jobs:
- checkout_code
- analyse_js:
requires:
- checkout_code
- e2e_release_ios:
requires:
- analyse_js
- e2e_release_android:
requires:
- analyse_js
- analyse_js
- e2e_release_ios
- e2e_release_android
- publish:
requires:
- e2e_release_android
Expand Down
26 changes: 4 additions & 22 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,9 @@
; Ignore polyfills
node_modules/react-native/Libraries/polyfills/.*

; These should not be required directly
; require from fbjs/lib instead: require('fbjs/lib/warning')
node_modules/warning/.*

; Flow doesn't support platforms
.*/Libraries/Utilities/LoadingView.js

; These should not be required directly
; require from fbjs/lib instead: require('fbjs/lib/warning')
node_modules/warning/.*

; Flow doesn't support platforms
.*/Libraries/Utilities/HMRLoadingView.js

[untyped]
.*/node_modules/@react-native-community/cli/.*/.*

Expand All @@ -32,12 +21,11 @@ node_modules/react-native/interface.js
node_modules/react-native/flow/

[options]
module.system.node.resolve_dirname=node_modules
module.system.node.resolve_dirname=src
emoji=true

esproposal.optional_chaining=enable
esproposal.nullish_coalescing=enable
exact_by_default=true

format.bracket_spacing=false

module.file_ext=.js
module.file_ext=.json
Expand All @@ -53,10 +41,6 @@ suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

[lints]
sketchy-null-number=warn
sketchy-null-mixed=warn
Expand All @@ -65,10 +49,8 @@ untyped-type-import=warn
nonstrict-import=warn
deprecated-type=warn
unsafe-getters-setters=warn
inexact-spread=warn
unnecessary-invariant=warn
signature-verification-failure=warn
deprecated-utility=error

[strict]
deprecated-type
Expand All @@ -80,4 +62,4 @@ untyped-import
untyped-type-import

[version]
^0.113.0
^0.158.0
Loading

0 comments on commit da12e92

Please sign in to comment.