Skip to content

Commit

Permalink
chore: CI deps update (#352)
Browse files Browse the repository at this point in the history
## 馃摐 Description

Updated CI deps.

## 馃挕 Motivation and Context

The main aim is:
- to avoid deprecated methods;
- to have faster CI;
- to be less affected by random errors (hello `e2e` tests 馃憢 );

## 馃摙 Changelog

### CI
- use `macos-14` instead of `macos-12` (since it has better
performance);
- since iPhone 13 is not available by default in latest Xcode -> I
switched to iPhone 15;
- use `ubuntu-latest` with KVM enabled instead of `macos-12` for Android
e2e tests (since it's faster and `macos-14` can not be used for running
android emulator yet);
- used latest versions of `setup-node`, `setup-java`, `checkout`,
`cache` and other default actions provided by GH;
- migrated to Java 17 (in android app build and e2e, build and lint
still are using Java 11 because I'm using old gradle version);
- cache AVD (for faster emulator startup);

### E2E

- updated `detox`;
- use `iPhone 15 Pro` for `e2e` test;
- updated iOS assets (since iPhone 15 is used instead of iPhone 13);

## 馃 How Has This Been Tested?

Tested on CI 馃檪 

## 馃摳 Screenshots (if appropriate):

|Before|After|
|-------|-----|
|<img width="521" alt="image"
src="https://github.com/kirillzyusko/react-native-keyboard-controller/assets/22820318/cdaa5cab-f6f4-481b-a731-5ce1c3e4e467">|<img
width="572" alt="image"
src="https://github.com/kirillzyusko/react-native-keyboard-controller/assets/22820318/5d0bc72c-b245-4816-bf68-940ee0c7f437">|

## 馃摑 Checklist

- [x] CI successfully passed
- [x] I added new mocks and corresponding unit-tests if library API was
changed
  • Loading branch information
kirillzyusko committed Feb 2, 2024
1 parent 28a7eeb commit 6859701
Show file tree
Hide file tree
Showing 50 changed files with 153 additions and 82 deletions.
36 changes: 25 additions & 11 deletions .github/workflows/android-e2e-test.yml
Expand Up @@ -22,29 +22,30 @@ on:
jobs:
test:
name: 鈿欙笍 Automated test cases
runs-on: macos-12
runs-on: ubuntu-latest
timeout-minutes: 60
env:
WORKING_DIRECTORY: example
API_LEVEL: 28
concurrency:
group: android-e2e-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18.x
cache: "yarn"
- name: Setup JDK 11
uses: actions/setup-java@v3
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: "microsoft"
java-version: "11"
java-version: "17"
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Restore node_modules from cache
uses: actions/cache@v3
uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
Expand All @@ -59,7 +60,7 @@ jobs:
- name: Install e2e dependencies
run: yarn install --cwd e2e
- name: Restore Gradle cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
Expand All @@ -70,11 +71,24 @@ jobs:
- name: Build app
working-directory: e2e
run: yarn build-example:android
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ env.API_LEVEL }}
- name: Run emulator and tests
uses: reactivecircus/android-emulator-runner@v2.28.0
uses: reactivecircus/android-emulator-runner@v2.30.1
with:
working-directory: e2e
api-level: 28
api-level: ${{ env.API_LEVEL }}
target: default
profile: pixel_2
ram-size: "4096M"
Expand All @@ -83,7 +97,7 @@ jobs:
avd-name: e2e_emulator
arch: x86_64
script: yarn test-example:android
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: android-fail-screen-shoots
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/build-android-fabric.yml
Expand Up @@ -25,19 +25,19 @@ jobs:
name: Build Android Fabric Example App
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup JDK 11
uses: actions/setup-java@v3
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: "microsoft"
java-version: "11"
java-version: "17"

- name: Get yarn cache directory path
id: fabric-yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Restore node_modules from cache
uses: actions/cache@v3
uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.fabric-yarn-cache-dir-path.outputs.dir }}
Expand All @@ -48,7 +48,7 @@ jobs:
run: yarn install --frozen-lockfile --cwd FabricExample

- name: Restore Gradle cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/build-android.yml
Expand Up @@ -23,19 +23,19 @@ jobs:
name: Build Android Example App
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup JDK 11
uses: actions/setup-java@v3
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: "microsoft"
java-version: "11"
java-version: "17"

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Restore node_modules from cache
uses: actions/cache@v3
uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
Expand All @@ -46,7 +46,7 @@ jobs:
run: yarn install --frozen-lockfile --cwd example

- name: Restore Gradle cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-ios-fabric.yml
Expand Up @@ -27,18 +27,18 @@ on:
jobs:
build:
name: Build iOS FabricExample App
runs-on: macOS-12
runs-on: macOS-14
defaults:
run:
working-directory: FabricExample/ios
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Get yarn cache directory path
id: fabric-yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Restore node_modules from cache
uses: actions/cache@v3
uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.fabric-yarn-cache-dir-path.outputs.dir }}
Expand All @@ -62,7 +62,7 @@ jobs:
working-directory: FabricExample/ios

- name: Restore Pods cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
FabricExample/ios/Pods
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-ios.yml
Expand Up @@ -25,18 +25,18 @@ on:
jobs:
build:
name: Build iOS Example App
runs-on: macOS-12
runs-on: macOS-14
defaults:
run:
working-directory: example/ios
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Restore node_modules from cache
uses: actions/cache@v3
uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
Expand All @@ -58,7 +58,7 @@ jobs:
working-directory: example/ios

- name: Restore Pods cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
example/ios/Pods
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/compress-images.yml
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Compress Images
uses: calibreapp/image-actions@main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/compress-lottie.yml
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Compress Lottie
run: find . -name '*.lottie.json' -exec npx lottie-optim -p 1 -o {} {} \;
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-docs.yml
Expand Up @@ -18,8 +18,8 @@ jobs:
run:
working-directory: ./docs
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18.x
cache: yarn
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-e2e.yml
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ios-e2e-test.yml
Expand Up @@ -24,16 +24,16 @@ on:
jobs:
test:
name: 鈿欙笍 Automated test cases
runs-on: macos-12
runs-on: macos-14
timeout-minutes: 60
env:
WORKING_DIRECTORY: example
concurrency:
group: ios-e2e-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18.x
cache: "yarn"
Expand All @@ -45,7 +45,7 @@ jobs:
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Restore node_modules from cache
uses: actions/cache@v3
uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
Expand All @@ -65,7 +65,7 @@ jobs:
with:
cache_key: react-native-keyboard-controller-e2e
- name: Restore Pods cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
example/ios/Pods
Expand All @@ -85,7 +85,7 @@ jobs:
- name: Test app
working-directory: e2e
run: yarn test-example:ios
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: ios-fail-screen-shoots
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Expand Up @@ -7,9 +7,9 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: "18.x"
registry-url: "https://registry.npmjs.org"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/size-diff.yml
Expand Up @@ -15,15 +15,15 @@ jobs:
pull-requests: write
steps:
- name: Checkout to target branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Calculate size of package (target)
id: old-size
run: echo "OLD_SIZE=$(node scripts/size.js)" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Calculate size of package (current)
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/verify-android.yml
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
name: 馃攷 Kotlin Lint
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: touchlab-lab/ktlint-action-setup@1.0.0
with:
ktlint_version: 0.48.0
Expand All @@ -31,9 +31,9 @@ jobs:
run:
working-directory: ./android
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup JDK 11
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: "microsoft"
java-version: "11"
Expand All @@ -48,9 +48,9 @@ jobs:
run:
working-directory: ./android
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup JDK 11
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: "microsoft"
java-version: "11"
Expand All @@ -65,12 +65,12 @@ jobs:
run:
working-directory: ./android
steps:
- uses: actions/checkout@v3
- name: Setup JDK 11
uses: actions/setup-java@v3
- uses: actions/checkout@v4
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: "microsoft"
java-version: "11"
java-version: "17"
- name: Install Detekt
run: |
curl -sSLO https://github.com/detekt/detekt/releases/download/v1.23.1/detekt-cli-1.23.1.zip
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/verify-cpp.yml
Expand Up @@ -21,10 +21,10 @@ jobs:
python-version: [3.7]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down

0 comments on commit 6859701

Please sign in to comment.