Skip to content

Commit d4f2e48

Browse files
committed
Move lint and unit tests from CircleCI to Buildkite
1 parent f5d463f commit d4f2e48

File tree

5 files changed

+67
-19
lines changed

5 files changed

+67
-19
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash -eu
2+
3+
# --legacy-peer-deps is necessary because of react-monaco-editor.
4+
# See README for more details
5+
install_npm_packages_clean --legacy-peer-deps

.buildkite/pipeline.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
env:
2+
BUILDKITE_PLUGINS_ALWAYS_CLONE_FRESH: 1
3+
4+
steps:
5+
- label: Build cache
6+
key: build_cache
7+
agents:
8+
queue: mac
9+
env:
10+
IMAGE_ID: $IMAGE_ID
11+
plugins:
12+
- $CI_TOOLKIT_PLUGIN
13+
- $NVM_PLUGIN
14+
command: |
15+
echo "--- :npm: Pre-build npm cache if needed"
16+
.buildkite/commands/install_node_dependencies.sh
17+
18+
- label: Lint
19+
key: lint
20+
depends_on: build_cache
21+
agents:
22+
queue: mac
23+
env:
24+
IMAGE_ID: $IMAGE_ID
25+
NODE_ENV: test
26+
plugins:
27+
- $CI_TOOLKIT_PLUGIN
28+
- $NVM_PLUGIN
29+
command: |
30+
.buildkite/commands/install_node_dependencies.sh
31+
echo "--- :eslint: Lint"
32+
make lint
33+
34+
- label: Test
35+
key: test
36+
depends_on: build_cache
37+
agents:
38+
queue: mac
39+
env:
40+
IMAGE_ID: $IMAGE_ID
41+
NODE_ENV: test
42+
plugins:
43+
- $CI_TOOLKIT_PLUGIN
44+
- $NVM_PLUGIN
45+
command: |
46+
.buildkite/commands/install_node_dependencies.sh
47+
echo "--- :jest: Test"
48+
npm test

.buildkite/shared-pipeline-vars

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
3+
# This file is `source`'d before calling `buildkite-agent pipeline upload`, and can be used
4+
# to set up some variables that will be interpolated in the `.yml` pipeline before uploading it.
5+
6+
# The ~> modifier is not currently used, but we check for it just in case
7+
XCODE_VERSION=$(sed -E -n 's/^(~> )?(.*)/xcode-\2/p' .xcode-version)
8+
CI_TOOLKIT_PLUGIN_VERSION='mokagio/npm_ci'
9+
NVM_PLUGIN_VERSION='0.3.0'
10+
11+
export IMAGE_ID="$XCODE_VERSION"
12+
export CI_TOOLKIT_PLUGIN="automattic/a8c-ci-toolkit#$CI_TOOLKIT_PLUGIN_VERSION"
13+
export NVM_PLUGIN="automattic/nvm#$NVM_PLUGIN_VERSION"

.circleci/config.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -98,23 +98,6 @@ jobs:
9898
- persist_to_workspace:
9999
root: ~/simplenote
100100
paths: *app_cache_paths
101-
test:
102-
docker:
103-
- image: cimg/node:18.19.1
104-
shell: /bin/bash --login
105-
working_directory: ~/simplenote
106-
steps:
107-
- *install_linux_deps
108-
- checkout
109-
- *decrypt
110-
- *restore_nvm
111-
- *setup_nvm
112-
- *save_nvm
113-
- *npm_restore_cache
114-
- *npm_install
115-
- run: NODE_ENV=test npm run build
116-
- run: npm test
117-
- run: npm run lint
118101

119102
linux:
120103
docker:
@@ -268,8 +251,6 @@ workflows:
268251
jobs:
269252
- build:
270253
filters: *job_filters
271-
- test:
272-
filters: *job_filters
273254
- linux:
274255
requires:
275256
- build

.xcode-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
15.4

0 commit comments

Comments
 (0)