Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI improvements #1

Merged
merged 3 commits into from
Oct 18, 2024
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
4 changes: 2 additions & 2 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ runs:
using: composite
steps:
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- name: Cache dependencies
id: yarn-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
**/node_modules
Expand Down
32 changes: 21 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup
Expand All @@ -28,21 +28,31 @@ jobs:

test:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Run unit tests
run: yarn test --maxWorkers=2 --coverage
run: yarn test:ci

- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the previous step fails
with:
report_paths: './junit.xml'

build-library:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup
Expand All @@ -56,13 +66,13 @@ jobs:
TURBO_CACHE_DIR: .turbo/android
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Cache turborepo for Android
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock') }}
Expand All @@ -79,7 +89,7 @@ jobs:

- name: Install JDK
if: env.turbo_cache_hit != 1
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
Expand All @@ -91,7 +101,7 @@ jobs:

- name: Cache Gradle
if: env.turbo_cache_hit != 1
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.gradle/wrapper
Expand All @@ -112,13 +122,13 @@ jobs:
TURBO_CACHE_DIR: .turbo/ios
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Cache turborepo for iOS
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock') }}
Expand All @@ -136,7 +146,7 @@ jobs:
- name: Cache cocoapods
if: env.turbo_cache_hit != 1
id: cocoapods-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
**/ios/Pods
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,5 @@ android/generated
example/ios/.xcode.env.local

# CI results
coverage
coverage
junit.xml
3 changes: 3 additions & 0 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ if linkage != nil
use_frameworks! :linkage => linkage.to_sym
end

# Silence warnings in code we don't own
inhibit_all_warnings!

target 'PushInfoExample' do
config = use_native_modules!

Expand Down
2 changes: 1 addition & 1 deletion example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1791,6 +1791,6 @@ SPEC CHECKSUMS:
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6

PODFILE CHECKSUM: 99128fce2aba851ac19f61eecbabebe2f94105ed
PODFILE CHECKSUM: b31792f230c6e53e3151193d6775ab4348783a4f

COCOAPODS: 1.15.2
10 changes: 8 additions & 2 deletions example/ios/PushInfoExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,10 @@
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
);
OTHER_LDFLAGS = "$(inherited) ";
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
Expand Down Expand Up @@ -669,7 +672,10 @@
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
);
OTHER_LDFLAGS = "$(inherited) ";
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
USE_HERMES = true;
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"scripts": {
"example": "yarn workspace react-native-push-info-example",
"test": "jest",
"test:ci": "jest -ci --coverage --reporters=default --reporters=jest-junit",
"typecheck": "tsc",
"lint": "eslint \"**/*.{js,ts,tsx}\"",
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
Expand Down Expand Up @@ -75,6 +76,7 @@
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.1",
"jest": "^29.7.0",
"jest-junit": "^16.0.0",
"prettier": "^3.0.3",
"react": "18.3.1",
"react-native": "0.75.4",
Expand Down
29 changes: 29 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8140,6 +8140,18 @@ __metadata:
languageName: node
linkType: hard

"jest-junit@npm:^16.0.0":
version: 16.0.0
resolution: "jest-junit@npm:16.0.0"
dependencies:
mkdirp: ^1.0.4
strip-ansi: ^6.0.1
uuid: ^8.3.2
xml: ^1.0.1
checksum: 412aa4bfeec4254a9b34f417fda79107c7cbd295e56ffeb299ac9c977545910fbabe57c91c6cd1f12b700d4a1f60f79872b0075003f02da87d463e30fc2d9d78
languageName: node
linkType: hard

"jest-leak-detector@npm:^29.7.0":
version: 29.7.0
resolution: "jest-leak-detector@npm:29.7.0"
Expand Down Expand Up @@ -10752,6 +10764,7 @@ __metadata:
eslint-config-prettier: ^9.0.0
eslint-plugin-prettier: ^5.0.1
jest: ^29.7.0
jest-junit: ^16.0.0
prettier: ^3.0.3
react: 18.3.1
react-native: 0.75.4
Expand Down Expand Up @@ -12803,6 +12816,15 @@ __metadata:
languageName: node
linkType: hard

"uuid@npm:^8.3.2":
version: 8.3.2
resolution: "uuid@npm:8.3.2"
bin:
uuid: dist/bin/uuid
checksum: 5575a8a75c13120e2f10e6ddc801b2c7ed7d8f3c8ac22c7ed0c7b2ba6383ec0abda88c905085d630e251719e0777045ae3236f04c812184b7c765f63a70e58df
languageName: node
linkType: hard

"v8-compile-cache-lib@npm:^3.0.1":
version: 3.0.1
resolution: "v8-compile-cache-lib@npm:3.0.1"
Expand Down Expand Up @@ -13136,6 +13158,13 @@ __metadata:
languageName: node
linkType: hard

"xml@npm:^1.0.1":
version: 1.0.1
resolution: "xml@npm:1.0.1"
checksum: 11b5545ef3f8fec3fa29ce251f50ad7b6c97c103ed4d851306ec23366f5fa4699dd6a942262df52313a0cd1840ab26256da253c023bad3309d8ce46fe6020ca0
languageName: node
linkType: hard

"xtend@npm:~4.0.1":
version: 4.0.2
resolution: "xtend@npm:4.0.2"
Expand Down
Loading