Skip to content

Commit

Permalink
Merge branch 'trunk' of github.com:wordpress-mobile/gutenberg-mobile …
Browse files Browse the repository at this point in the history
…into version-toolkit/gutenberg/rnmobile/appium-2
  • Loading branch information
dcalhoun committed Oct 25, 2023
2 parents d549482 + 947cf71 commit 9caab15
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .buildkite/commands/build-ios.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -eu

echo '--- :node: Setup Node depenendencies'
npm ci
npm ci --unsafe-perm --prefer-offline --no-audit --no-progress

echo '--- :ios: Set env var for iOS E2E testing'
set -x
Expand Down
7 changes: 7 additions & 0 deletions .buildkite/commands/lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash -eu

echo "--- :npm: Install Node dependencies"
npm ci --unsafe-perm --prefer-offline --no-audit --no-progress

echo "--- :node: Lint"
CHECK_CORRECTNESS=true CHECK_TESTS=false ./bin/ci-checks-js.sh
2 changes: 1 addition & 1 deletion .buildkite/commands/publish-react-native-ios-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ mkdir -p ios-xcframework/Gutenberg/Resources
tar -xzvf ios-assets.tar.gz -C ios-xcframework/Gutenberg/Resources/

echo '--- :node: Setup node_modules for RNReanimated'
npm ci
npm ci --unsafe-perm --prefer-offline --no-audit --no-progress

echo "--- :rubygems: Setting up Gems"
cd ./ios-xcframework
Expand Down
7 changes: 7 additions & 0 deletions .buildkite/commands/unit-tests-android.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash -eu

echo "--- :npm: Install Node dependencies"
npm ci --unsafe-perm --prefer-offline --no-audit --no-progress

echo "--- :node: Lint and Unit Tests"
CHECK_CORRECTNESS=false CHECK_TESTS=true TEST_RN_PLATFORM=android ./bin/ci-checks-js.sh
7 changes: 7 additions & 0 deletions .buildkite/commands/unit-tests-ios.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash -eu

echo "--- :npm: Install Node dependencies"
npm ci --unsafe-perm --prefer-offline --no-audit --no-progress

echo "--- :node: Lint and Unit Tests"
CHECK_CORRECTNESS=false CHECK_TESTS=true TEST_RN_PLATFORM=ios ./bin/ci-checks-js.sh
63 changes: 53 additions & 10 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,32 +33,70 @@ x-common-params:
build.branch != 'trunk' && build.branch !~ /^release.*/ && build.branch !~ /^dependabot\/submodules.*/

steps:
- label: Lint and Unit Tests
key: unit-tests
- label: Lint
key: lint
plugins:
- *gb-mobile-docker-container
- *git-cache-plugin
command: |
echo "--- :docker: Additional Docker image setup"
source /root/.bashrc
echo "--- :node: Setup Node environment"
echo "--- :docker::node: Setup Node environment"
nvm install && nvm use
echo "--- :npm: Install Node dependencies"
npm ci --unsafe-perm --prefer-offline --no-audit --no-progress
.buildkite/commands/lint.sh
notify:
- github_commit_status:
context: Lint

- label: Android Unit Tests
key: android-unit-tests
plugins:
- *gb-mobile-docker-container
- *ci_toolkit_plugin
command: |
echo "--- :docker: Additional Docker image setup"
source /root/.bashrc
echo "--- :docker::node: Setup Node environment"
nvm install && nvm use
echo "--- :node: Lint and Unit Tests"
./bin/ci-checks-js.sh
.buildkite/commands/unit-tests-android.sh
env:
JEST_JUNIT_OUTPUT_FILE: reports/test-results/android-test-results.xml
artifact_paths:
- ./logs/*.log
- ./reports/test-results/*.xml
notify:
- github_commit_status:
context: Lint and Unit Tests
context: Android Unit Tests

- label: iOS Unit Tests
key: ios-unit-tests
plugins:
- *gb-mobile-docker-container
- *ci_toolkit_plugin
command: |
echo "--- :docker: Additional Docker image setup"
source /root/.bashrc
echo "--- :docker::node: Setup Node environment"
nvm install && nvm use
.buildkite/commands/unit-tests-ios.sh
artifact_paths:
- ./logs/*.log
- ./reports/test-results/*.xml
notify:
- github_commit_status:
context: iOS Unit Tests

- label: "Build JS Bundles"
depends_on: "unit-tests"
depends_on:
- lint
- android-unit-tests
- ios-unit-tests
key: "js-bundles"
plugins:
- *gb-mobile-docker-container
Expand Down Expand Up @@ -106,7 +144,9 @@ steps:
fi
- label: "Build Android RN Aztec & Publish to S3"
depends_on: unit-tests
depends_on:
- lint
- android-unit-tests
key: "publish-react-native-aztec-android"
plugins:
- *git-cache-plugin
Expand Down Expand Up @@ -137,6 +177,9 @@ steps:

- label: iOS Build and Sauce Labs
key: ios-build-and-saucelabs
depends_on:
- lint
- ios-unit-tests
command: .buildkite/commands/build-ios.sh
plugins:
- *ci_toolkit_plugin
Expand Down
5 changes: 3 additions & 2 deletions bin/ci-checks-js.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ function pFail() {

function checkDiff() {
set +e
diff=$(git diff)
LOCKFILE='package-lock.json'
diff=$(git diff -- "$LOCKFILE")
set -e
if [[ $? != 0 ]]; then
pFail
elif [[ $diff ]]; then
echo "$diff"
pFail "package-lock.json has changed. Please run npm install and commit the diff"
pFail "$LOCKFILE has changed. Please run npm install and commit the diff"
else
pOk
fi
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9caab15

Please sign in to comment.