Skip to content

Commit

Permalink
Merge pull request #5 from wordpress-mobile/develop
Browse files Browse the repository at this point in the history
Update master branch from original repo
  • Loading branch information
fluiddot authored Dec 21, 2020
2 parents 10c6da0 + 3586bbf commit 46e365d
Show file tree
Hide file tree
Showing 230 changed files with 6,536 additions and 13,374 deletions.
69 changes: 47 additions & 22 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ commands:
name: Create reports directory
command: mkdir reports && mkdir reports/test-results

parameters:
android-docker-image:
type: string
# Hash points to previous version with node 12. When everything works with node 14 it can be removed
default: "circleci/android:api-29-node@sha256:71d61d6c21b29948d57120f476a83cc322a280979bce355c5a0ad771293ca380"

jobs:
checks:
parameters:
Expand All @@ -58,7 +64,7 @@ jobs:
type: boolean
default: false
docker:
- image: circleci/node:10
- image: circleci/node:14
steps:
- checkout
- checkout-submodules
Expand Down Expand Up @@ -93,37 +99,41 @@ jobs:
is-canary:
type: string
default: ""
docker:
- image: circleci/android:api-29-node
environment:
JAVA_OPTS: '-Xms512m -Xmx2g'
GRADLE_OPTS: '-Xmx3g -Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-Xmx2g -XX:+HeapDumpOnOutOfMemoryError"'
machine:
image: ubuntu-2004:202010-01 # Latest supported ubuntu image from https://circleci.com/docs/2.0/configuration-reference/#available-machine-images
steps:
- checkout
- checkout-submodules
- run: node -v
- run: npm install -g yarn
- npm-install
- add-jest-reporter-dir
- run: npm run test:e2e:bundle:android
- run:
name: Set Environment Variables
name: Build apk
command: |
echo 'export TEST_RN_PLATFORM=android' >> $BASH_ENV
echo 'export TEST_ENV=sauce' >> $BASH_ENV
- run:
name: Bundle Android and Generate debug .apk file for testing
command: npm run test:e2e:bundle:android && npm run test:e2e:build-app:android
docker run --rm -it \
--volume $(pwd):/home/circleci/project \
--workdir /home/circleci/project \
--env JAVA_OPTS='-Xms512m -Xmx2g' \
--env GRADLE_OPTS='-Xmx3g -Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-Xmx2g -XX:+HeapDumpOnOutOfMemoryError"' \
<< pipeline.parameters.android-docker-image >> \
/bin/bash -c "sudo chown -R circleci:circleci . && npm run core test:e2e:build-app:android"
- run:
name: Upload apk to sauce labs
command: |
source bin/sauce-pre-upload.sh
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST -H "Content-Type: application/octet-stream" https://saucelabs.com/rest/v1/storage/automattic/Gutenberg-$SAUCE_FILENAME.apk?overwrite=true --data-binary @./gutenberg/packages/react-native-editor/android/app/build/outputs/apk/debug/app-debug.apk
- run: mkdir /home/circleci/test-results
- run:
name: Run Device Tests
command: npm run device-tests<<parameters.is-canary>>
no_output_timeout: 1200
environment:
JEST_JUNIT_OUTPUT: "reports/test-results/android-test-results.xml"
TEST_RN_PLATFORM: android
TEST_ENV: sauce
JEST_JUNIT_OUTPUT: "/home/circleci/test-results/android-test-results.xml"
- store_test_results:
path: ./reports/test-results
path: /home/circleci/test-results
- when:
condition: << parameters.post-to-slack >>
steps:
Expand All @@ -139,7 +149,7 @@ jobs:
type: boolean
default: false
docker:
- image: circleci/android:api-29-node
- image: << pipeline.parameters.android-docker-image >>
steps:
- checkout
- checkout-submodules
Expand All @@ -157,7 +167,7 @@ jobs:
type: string
default: ""
macos:
xcode: "11.2.1"
xcode: "12.0.0"
steps:
- checkout
- checkout-submodules
Expand All @@ -184,7 +194,7 @@ jobs:
- dependencies-v4-
- run:
name: Build (if needed)
command: test -e gutenberg/packages/react-native-editor/ios/build/gutenberg/Build/Products/Release-iphonesimulator/gutenberg.app || SKIP_BUNDLING=true npm run core test:e2e:build-app:ios
command: test -e gutenberg/packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app || npm run core test:e2e:build-app:ios
- save_cache:
name: Save Dependencies Cache
key: dependencies-v4-{{ checksum "gutenberg/packages/react-native-editor/ios/Gemfile.lock" }}-{{ checksum "gutenberg/packages/react-native-editor/ios/Podfile.lock" }}-{{ checksum "gutenberg/package-lock.json" }}
Expand All @@ -198,12 +208,14 @@ jobs:
command: npm run test:e2e:bundle:ios
- run:
name: Generate .app file for testing
command: WORK_DIR=$(pwd) && cd ./gutenberg/packages/react-native-editor/ios/build/gutenberg/Build/Products/Release-iphonesimulator && zip -r $WORK_DIR/gutenberg/packages/react-native-editor/ios/gutenberg.app.zip gutenberg.app
command: WORK_DIR=$(pwd) && cd ./gutenberg/packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator && zip -r $WORK_DIR/gutenberg/packages/react-native-editor/ios/GutenbergDemo.app.zip GutenbergDemo.app
- run:
name: Upload .app to sauce labs
command: |
source bin/sauce-pre-upload.sh
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST -H "Content-Type: application/octet-stream" https://saucelabs.com/rest/v1/storage/automattic/Gutenberg-$SAUCE_FILENAME.app.zip?overwrite=true --data-binary @./gutenberg/packages/react-native-editor/ios/gutenberg.app.zip
HOMEBREW_NO_AUTO_UPDATE=1 brew install curl
/usr/local/opt/curl/bin/curl --version
/usr/local/opt/curl/bin/curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST -H "Content-Type: application/octet-stream" https://saucelabs.com/rest/v1/storage/automattic/Gutenberg-$SAUCE_FILENAME.app.zip?overwrite=true --data-binary @./gutenberg/packages/react-native-editor/ios/GutenbergDemo.app.zip
- run:
name: Run Device Tests
command: |
Expand All @@ -215,12 +227,12 @@ jobs:
path: ./reports/test-results
- run:
name: Prepare build cache
command: rm gutenberg/packages/react-native-editor/ios/build/gutenberg/Build/Products/Release-iphonesimulator/gutenberg.app/main.jsbundle
command: rm gutenberg/packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app/main.jsbundle
- save_cache:
name: Save Build Cache
key: ios-build-cache-{{ checksum "ios-checksums.txt" }}
paths:
- gutenberg/packages/react-native-editor/ios/build/gutenberg/Build/Products/Release-iphonesimulator/gutenberg.app
- gutenberg/packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app
- when:
condition: << parameters.post-to-slack >>
steps:
Expand Down Expand Up @@ -256,6 +268,7 @@ workflows:
branches:
ignore:
- develop
- /^dependabot/submodules/.*/
- ios-device-checks:
name: Test iOS on Device - Full
requires: [ "Optional UI Tests" ]
Expand All @@ -264,6 +277,18 @@ workflows:
requires: [ "Optional UI Tests" ]
- android-native-unit-tests:
name: Android Native Unit Tests
- ios-device-checks:
name: Test iOS on Device - Full (Submodule Update)
post-to-slack: true
filters:
branches:
only: /^dependabot/submodules/.*/
- android-device-checks:
name: Test Android on Device - Full (Submodule Update)
post-to-slack: true
filters:
branches:
only: /^dependabot/submodules/.*/

ui-tests-full-scheduled:
jobs:
Expand Down
35 changes: 0 additions & 35 deletions .github/PULL_REQUEST_TEMPLATE/release_pull_request.md

This file was deleted.

11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "gitsubmodule" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ android/app/src/main/assets/
gen/
build/
build.log
bundle/android/raw/*
bundle/android/App.js
bundle/android/App.js.map
bundle/android/App.text.js
bundle/android/App.text.js.map
bundle/ios/assets/gutenberg/packages/block-library/src/*

# Local configuration file (sdk path, etc)
local.properties
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ For a developer experience closer to the one the project maintainers current hav
* git
* [nvm](https://github.com/creationix/nvm)
* Node.js and npm (use nvm to install them)
* [Yarn](https://yarnpkg.com/)
* [AndroidStudio](https://developer.android.com/studio/) to be able to compile the Android version of the app
* [Xcode](https://developer.apple.com/xcode/) to be able to compile the iOS app
* CocoaPods(`sudo gem install cocoapods`) needed to fetch React and third-party dependencies.
* [Carthage](https://github.com/Carthage/Carthage#installing-carthage) for appium to be able run iOS UI tests

Note that the OS platform used by the maintainers is macOS but the tools and setup should be usable in other platforms too.

Expand Down
39 changes: 38 additions & 1 deletion RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,43 @@
Unreleased
------
* [***] Full-width and wide alignment support for Columns
* [***] New Block: File [https://github.com/wordpress-mobile/gutenberg-mobile/pull/2835]
* [**] Image block - Add link picker to the block settings and enhance link settings with auto-hide options [https://github.com/WordPress/gutenberg/pull/27292]
* [*] Fix button link setting, rel link will not be overwritten if modified by the user.

1.42.0
------
* [**] Button block - Add link picker to the block settings [https://github.com/WordPress/gutenberg/pull/26206]
* [**] Fix gradient picker causing crash in some themes (like Spearhead) [https://github.com/WordPress/gutenberg/pull/27307]
* [***] Adding support for selecting different unit of value in Cover and Columns blocks [https://github.com/WordPress/gutenberg/pull/26161]
* [*] Fix theme colors syncing with the editor [https://github.com/WordPress/gutenberg/pull/26821]

1.41.0
------

* [***] Faster editor start and overall operation on Android. [https://github.com/wordpress-mobile/gutenberg-mobile/pull/2780]
* [*] [Android] Enable multiple upload support for Image block. [https://github.com/wordpress-mobile/gutenberg-mobile/pull/2530]

1.40.0
------


1.39.0
------
* [***] Full-width and wide alignment support for Video, Latest-posts, Gallery, Media & text, and Pullquote block. [https://github.com/wordpress-mobile/gutenberg-mobile/pull/2605]

1.38.1
------
* [***] Fix unsupported block bottom sheet is triggered when device is rotated. [https://github.com/wordpress-mobile/gutenberg-mobile/pull/2710]
* [***] Unsupported Block Editor: Fixed issue when cannot view or interact with the classic block on Jetpack site. [https://github.com/wordpress-mobile/gutenberg-mobile/pull/2709]

1.38.0
------
* [**] Increase tap-target of primary action on unsupported blocks.
* [**] Increase tap-target of primary action on unsupported blocks. [https://github.com/wordpress-mobile/gutenberg-mobile/pull/2608]
* [***] On Jetpack connected sites, Unsupported Block Editor can be enabled via enabling Jetpack SSO setting directly from within the missing block alert. [https://github.com/wordpress-mobile/gutenberg-mobile/pull/2610]
* [***] Add support for selecting user's post when configuring the link [https://github.com/wordpress-mobile/gutenberg-mobile/pull/2484]
* [**] [Android] Fix for a crash that can occur when long pressing selected images [https://github.com/wordpress-mobile/AztecEditor-Android/pull/924]
* [***] [Android] Added expected double tap for focus behavior for text fields in accessibility mode [https://github.com/WordPress/gutenberg/pull/25384]

1.37.1
------
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions __device-tests__/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: '../gutenberg/packages/react-native-editor/__device-tests__/.eslintrc.js',
};
36 changes: 0 additions & 36 deletions __device-tests__/gutenberg-editor-contact-info.test.js
Original file line number Diff line number Diff line change
@@ -1,48 +1,12 @@
/**
* Internal dependencies
*/
import EditorPage from '../gutenberg/packages/react-native-editor/__device-tests__/pages/editor-page';
import {
setupDriver,
isLocalEnvironment,
stopDriver,
} from '../gutenberg/packages/react-native-editor/__device-tests__/helpers/utils';

jest.setTimeout( 1000000 );

describe( 'Gutenberg Editor Contact Info Block tests', () => {
let driver;
let editorPage;
let allPassed = true;
// const contactInfoBlockName = 'Contact Info';

// Use reporter for setting status for saucelabs Job
if ( ! isLocalEnvironment() ) {
const reporter = {
specDone: async ( result ) => {
allPassed = allPassed && result.status !== 'failed';
},
};

// eslint-disable-next-line jest/no-jasmine-globals
jasmine.getEnv().addReporter( reporter );
}

beforeAll( async () => {
driver = await setupDriver();
editorPage = new EditorPage( driver );
} );

it( 'should be able to see visual editor', async () => {
await expect( editorPage.getBlockList() ).resolves.toBe( true );
} );

//TODO: Add tests

afterAll( async () => {
if ( ! isLocalEnvironment() ) {
driver.sauceJobStatus( allPassed );
}
await stopDriver( driver );
} );
} );
1 change: 1 addition & 0 deletions bin/ci-checks-js.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function checkDiff() {
if [[ $? != 0 ]]; then
pFail
elif [[ $diff ]]; then
echo "$diff"
pFail "package-lock.json has changed. Please run npm install and commit the diff"
else
pOk
Expand Down
Loading

0 comments on commit 46e365d

Please sign in to comment.