Skip to content

Commit f8b32ee

Browse files
authored
Merge pull request #996 from wordpress-mobile/move/everything-to-buildkite
Move CI to Buildkite
2 parents 3baca66 + 8e64001 commit f8b32ee

16 files changed

+114
-104
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
echo "--- :closed_lock_with_key: Installing Secrets"
6+
./gradlew applyConfiguration
7+
8+
echo -e "\n--- :gcloud: Logging into Google Cloud"
9+
gcloud auth activate-service-account --key-file .configure-files/firebase.secrets.json
10+
11+
echo -e "\n--- :hammer_and_wrench: Building Tests"
12+
./gradlew --stacktrace app:assembleDebug app:assembleDebugAndroidTest
13+
14+
echo -e "\n--- :firebase: Run Tests"
15+
gcloud firebase test android run \
16+
--project api-project-108380595987 \
17+
--type instrumentation \
18+
--app app/build/outputs/apk/debug/app-debug.apk \
19+
--test app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk \
20+
--device model=Nexus5X,version=26,locale=en,orientation=portrait \
21+
--verbosity info

.buildkite/commands/lint.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
echo "--- ktlint"
6+
./gradlew --stacktrace ktlint
7+
8+
echo -e "\n--- lintRelease"
9+
./gradlew --stacktrace lintRelease
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

.buildkite/commands/unit-test.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
echo "--- Unit Test"
6+
./gradlew --stacktrace aztec:testRelease
7+

.buildkite/pipeline.yml

Lines changed: 42 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,71 @@
1-
common-params:
2-
&publish-android-artifacts-docker-container
3-
docker#v3.8.0:
4-
image: "public.ecr.aws/automattic/android-build-image:v1.2.0"
5-
propagate-environment: true
6-
environment:
7-
# DO NOT MANUALLY SET THESE VALUES!
8-
# They are passed from the Buildkite agent to the Docker container
9-
- "AWS_ACCESS_KEY"
10-
- "AWS_SECRET_KEY"
1+
# Run everything on the `android` queue
2+
agents:
3+
queue: android
4+
5+
# Nodes with values to reuse in the pipeline.
6+
common_params:
7+
# Common plugin settings to use with the `plugins` key.
8+
- &common_plugins
9+
- automattic/bash-cache#2.6.0
1110

1211
steps:
12+
- label: "Lint"
13+
key: "lint"
14+
command: .buildkite/commands/lint.sh
15+
plugins: *common_plugins
16+
artifact_paths:
17+
- "aztec/build/reports/*"
18+
19+
- label: "Unit Tests"
20+
key: "test"
21+
command: .buildkite/commands/unit-test.sh
22+
plugins: *common_plugins
23+
artifact_paths:
24+
- "aztec/build/test-results/**/*.xml"
25+
26+
- label: "Connected Tests"
27+
key: "connected-test"
28+
command: .buildkite/commands/connected-tests.sh
29+
plugins: *common_plugins
30+
artifact_paths:
31+
- "aztec/build/test-results/**/*.xml"
32+
1333
- label: "Publish :aztec"
1434
key: "publish-aztec"
15-
plugins:
16-
- *publish-android-artifacts-docker-container
17-
command: |
18-
.buildkite/publish-aztec.sh
35+
command: .buildkite/commands/publish-aztec.sh
36+
plugins: *common_plugins
1937

2038
- label: "Publish :glide-loader"
2139
key: "publish-glide-loader"
2240
depends_on:
2341
- "publish-aztec"
24-
plugins:
25-
- *publish-android-artifacts-docker-container
26-
command: |
27-
.buildkite/publish-glide-loader.sh
42+
command: .buildkite/commands/publish-glide-loader.sh
43+
plugins: *common_plugins
2844

2945
- label: "Publish :picasso-loader"
3046
key: "publish-picasso-loader"
3147
depends_on:
3248
- "publish-aztec"
33-
plugins:
34-
- *publish-android-artifacts-docker-container
35-
command: |
36-
.buildkite/publish-picasso-loader.sh
49+
command: .buildkite/commands/publish-picasso-loader.sh
50+
plugins: *common_plugins
3751

3852
- label: "Publish :wordpress-shortcodes"
3953
key: "publish-wordpress-shortcodes"
4054
depends_on:
4155
- "publish-aztec"
42-
plugins:
43-
- *publish-android-artifacts-docker-container
44-
command: |
45-
.buildkite/publish-wordpress-shortcodes.sh
56+
command: .buildkite/commands/publish-wordpress-shortcodes.sh
57+
plugins: *common_plugins
4658

4759
- label: "Publish :wordpress-comments"
4860
key: "publish-wordpress-comments"
4961
depends_on:
5062
- "publish-aztec"
51-
plugins:
52-
- *publish-android-artifacts-docker-container
53-
command: |
54-
.buildkite/publish-wordpress-comments.sh
63+
command: .buildkite/commands/publish-wordpress-comments.sh
64+
plugins: *common_plugins
5565

5666
- label: "Publish :media-placeholders"
5767
key: "publish-media-placeholders"
5868
depends_on:
5969
- "publish-aztec"
60-
plugins:
61-
- *publish-android-artifacts-docker-container
62-
command: |
63-
.buildkite/publish-media-placeholders.sh
70+
command: .buildkite/commands/publish-media-placeholders.sh
71+
plugins: *common_plugins

0 commit comments

Comments
 (0)