Skip to content

Commit 2b15880

Browse files
CI configuration updated (#315)
* Turn on the JS Bundle build of Android and iOS The commented part of CI workflow was about to be turned on once detox is configured and ready to be used. NOTE: This commit is about to TEST whether this part is still valid. If the CI workflow fail and cannot be fixed it should be removed or replaced if possible. * Remove JS Bundle build from analyse step * Upgrade RN orb to 5.5.0 * Remove Detox from the package testing The Detox still have an issue with React Native and seems to not going forward with more support for it. It should not be slowing down the CI development - more convenient will be to configure the build and tests in old-fashioned way. * Build Windows OS Example app The Windows Example app is built using the [email protected] orb of CircleCI This configuration is based on self installed dependencies, as there's no `install` job in the CI workflow. This commit also adds the msbuild.binlog to the ignored files - this is the build result log file which can be changed anytime app is built. * Fix: missing downloadDependencies task for Android The Android example app could not be compiled due to no `downloadDependencies` task. This is fixed by adding it to the build.gradle configuration, so that rn/android can utilize it. * Remove release and detox jobs for Android * Rename to * Run tests separately from 'verify' job * Include Windows example build in workflow * Use custom example build job for iOS app The rn/ios_build job had an issue of being unable to build the workspace which would result in the static libraries unable to be found in the project. To avoid that the custom job has been implemented, which builds the iOS app from a workspace point of view, which has all the deps already linked and can be successfully used to verify the build. * Simplify and rename CI workflow to slider-full-ci * Regenarate the UWP certificate for Windows Example * Use local Slider package in the example source * Fix: unrecognized && syntax in powershell
1 parent 75344ab commit 2b15880

File tree

14 files changed

+101
-444
lines changed

14 files changed

+101
-444
lines changed

.circleci/config.yml

Lines changed: 62 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
version: 2.1
22

33
orbs:
4-
rn: react-native-community/[email protected]
4+
rn: react-native-community/[email protected]
5+
windows: circleci/[email protected]
56

67
jobs:
78
checkout_code:
@@ -11,7 +12,8 @@ jobs:
1112
- persist_to_workspace:
1213
root: .
1314
paths: .
14-
analyse:
15+
16+
verify:
1517
executor: rn/linux_js
1618
steps:
1719
- attach_workspace:
@@ -23,16 +25,49 @@ jobs:
2325
- run:
2426
name: Flow
2527
command: yarn run validate:flow
28+
29+
test:
30+
executor: rn/linux_js
31+
steps:
32+
- attach_workspace:
33+
at: .
34+
- rn/yarn_install
2635
- run:
27-
name: Jest
36+
name: Run unit tests with Jest
2837
command: yarn run test:jest
29-
# TODO: Uncomment after fixing detox setup
30-
# - run:
31-
# name: Build Android JavaScript Bundle
32-
# command: yarn run test:detox:android:bundle:release
33-
# - run:
34-
# name: Build iOS JavaScript Bundle
35-
# command: yarn run test:detox:ios:bundle:release
38+
39+
build_example_windows:
40+
executor:
41+
name: windows/default
42+
shell: powershell
43+
steps:
44+
- checkout
45+
- run:
46+
name: Install examples
47+
command: cd src; yarn install; cd ../example; yarn install --force --frozen-lockfile
48+
- run:
49+
name: "Restore NuGet packages for Components"
50+
command: nuget restore .\example\windows\SliderTestWindows.sln
51+
- run:
52+
name: "Restore .NET dependencies"
53+
command: msbuild -t:restore .\example\windows\SliderTestWindows.sln
54+
- run:
55+
name: Build example Windows
56+
command: cd example; npx react-native run-windows --no-packager --no-launch --arch x64 --logging --no-deploy
57+
58+
build_example_ios:
59+
executor: rn/macos
60+
steps:
61+
- checkout
62+
- run:
63+
name: Install deps
64+
command: cd src && yarn install && cd ../example && yarn install --force --frozen-lockfile
65+
- run:
66+
name: Install Pods
67+
command: cd example && npx pod-install
68+
- run:
69+
name: Build the iOS example project
70+
command: cd example/ios && export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace example.xcworkspace -destination 'platform=iOS Simulator,name=iPhone 11' -scheme example -parallelizeTargets -configuration Debug -derivedDataPath build -UseModernBuildSystem=YES
3671

3772
# To be uncommented as a part of https://github.com/react-native-community/react-native-slider/issues/34
3873
# publish:
@@ -46,41 +81,27 @@ jobs:
4681
# command: yarn ci:publish
4782

4883
workflows:
49-
test:
84+
slider-full-ci:
5085
jobs:
5186
- checkout_code
52-
- analyse:
87+
- verify:
5388
requires:
5489
- checkout_code
55-
# Disabled until Detox works correctly with 0.60
56-
# - rn/android_build:
57-
# name: build_android_debug
58-
# project_path: "example/android"
59-
# build_type: debug
60-
# requires:
61-
# - analyse
62-
# - rn/android_build:
63-
# name: build_android_release
64-
# project_path: "example/android"
65-
# build_type: release
66-
# requires:
67-
# - analyse
68-
# - rn/android_test:
69-
# detox_configuration: "android.emu.release"
70-
# detox_loglevel: "trace"
71-
# requires:
72-
# - build_android_release
73-
# - rn/ios_build_and_test:
74-
# project_path: "example/ios/example.xcworkspace"
75-
# derived_data_path: "example/ios/build"
76-
# device: "iPhone X"
77-
# build_configuration: "Release"
78-
# scheme: "example"
79-
# detox_configuration: "ios.sim.release"
80-
# detox_loglevel: "trace"
81-
# requires:
82-
# - analyse
83-
# To be uncommented as a part of https://github.com/react-native-community/react-native-slider/issues/34
90+
- test:
91+
requires:
92+
- verify
93+
- build_example_windows:
94+
requires:
95+
- verify
96+
- rn/android_build:
97+
name: build_android_debug
98+
project_path: "example/android"
99+
build_type: debug
100+
requires:
101+
- verify
102+
- build_example_ios:
103+
requires:
104+
- verify
84105
# - publish:
85106
# requires:
86107
# - analyse

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
#
33
.DS_Store
44

5+
# Windows OS
6+
#
7+
msbuild.binlog
8+
59
# Xcode
610
#
711
build/

example/android/app/build.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,19 @@ task copyDownloadableDepsToLibs(type: Copy) {
184184
into 'libs'
185185
}
186186

187+
task downloadDependencies() {
188+
description 'Download all dependencies to the Gradle cache'
189+
doLast {
190+
configurations.findAll().each { config ->
191+
if (config.name.contains("minReactNative") && config.canBeResolved) {
192+
print config.name
193+
print '\n'
194+
config.files
195+
}
196+
}
197+
}
198+
}
199+
187200
apply from: file("../../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle");
188201
// set custom root because we're in a monorepo
189202
applyNativeModulesAppBuildGradle(project)

example/e2e/config.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

example/e2e/init.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

example/e2e/testCases/example.e2e.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"run:web": "expo web"
1111
},
1212
"dependencies": {
13-
"@react-native-community/slider": "^4.0.0-rc.2",
13+
"@react-native-community/slider": "file:../src/",
1414
"babel-preset-expo": "^8.2.1",
1515
"expo": "^37.0.12",
1616
"react-dom": "~16.9.0",

example/windows/SliderTestWindows/Package.appxmanifest

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88

99
<Identity
1010
Name="sliderExample"
11-
Publisher="CN=igklemen"
11+
Publisher="CN=Bartosz Klonowski"
1212
Version="1.0.0.0" />
1313

1414
<mp:PhoneIdentity PhoneProductId="359e3698-40e8-432a-a406-1213a9404462" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
1515

1616
<Properties>
1717
<DisplayName>SliderTestWindows</DisplayName>
18-
<PublisherDisplayName>igklemen</PublisherDisplayName>
18+
<PublisherDisplayName>BartoszKlonowski</PublisherDisplayName>
1919
<Logo>Assets\StoreLogo.png</Logo>
2020
</Properties>
2121

example/windows/SliderTestWindows/SliderTestWindows.vcxproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
<ApplicationType>Windows Store</ApplicationType>
1515
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
1616
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.18362.0</WindowsTargetPlatformVersion>
17-
<WindowsTargetPlatformMinVersion>10.0.16299.0</WindowsTargetPlatformMinVersion>
1817
<PackageCertificateKeyFile>SliderTestWindows_TemporaryKey.pfx</PackageCertificateKeyFile>
19-
<PackageCertificateThumbprint>2B865F049A8EC254802CBE811120971BD5F2CDB5</PackageCertificateThumbprint>
18+
<WindowsTargetPlatformMinVersion>10.0.16299.0</WindowsTargetPlatformMinVersion>
19+
<PackageCertificateThumbprint>F4D37D3346135805DB0E33DEE0E9A100AB53BE42</PackageCertificateThumbprint>
2020
<PackageCertificatePassword>password</PackageCertificatePassword>
2121
</PropertyGroup>
2222
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -146,6 +146,7 @@
146146
<ItemGroup>
147147
<None Include="packages.config" />
148148
<None Include="PropertySheet.props" />
149+
<None Include="SliderTestWindows_TemporaryKey.pfx" />
149150
<Text Include="readme.txt">
150151
<DeploymentContent>false</DeploymentContent>
151152
</Text>
@@ -158,6 +159,7 @@
158159
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
159160
<PropertyGroup Label="ReactNativeWindowsNodeProps">
160161
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\</ReactNativeWindowsDir>
162+
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
161163
</PropertyGroup>
162164
<ImportGroup Label="ReactNativeWindowsNodeTargets">
163165
<Import Project="$(ReactNativeWindowsDir)PropertySheets\External\Microsoft.ReactNative.Uwp.CppApp.props" Condition="Exists('$(ReactNativeWindowsDir)PropertySheets\External\Microsoft.ReactNative.Uwp.CppApp.props')" />

example/windows/SliderTestWindows/SliderTestWindows.vcxproj.filters

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
<ItemGroup>
5454
<None Include="PropertySheet.props" />
5555
<None Include="packages.config" />
56+
<None Include="SliderTestWindows_TemporaryKey.pfx" />
5657
</ItemGroup>
5758
<ItemGroup>
5859
<Text Include="readme.txt" />

0 commit comments

Comments
 (0)