Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Commit 2ce87d6

Browse files
authored
Merge pull request #247 from AtomLinter/arcanemagus/fix-circleci
Fix CircleCI builds
2 parents ae7b10e + 3ce141d commit 2ce87d6

File tree

1 file changed

+75
-59
lines changed

1 file changed

+75
-59
lines changed

.circleci/config.yml

Lines changed: 75 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,113 @@
11
version: 2
22

33
defaults: &defaults
4-
working_directory: /tmp/project
5-
docker:
6-
- image: walberla/buildenv-ubuntu-clang:4.0
7-
environment:
8-
CIRCLE_BUILD_IMAGE: ubuntu
9-
ATOM_CHANNEL: stable
10-
DISPLAY: :99
4+
working_directory: /tmp/project
5+
docker:
6+
- image: arcanemagus/atom-docker-ci:stable
7+
steps:
8+
# Restore project state
9+
- attach_workspace:
10+
at: /tmp
11+
- run:
12+
name: Install Clang
13+
command: |
14+
sudo apt-get update && \
15+
sudo apt-get install --assume-yes --quiet --no-install-suggests \
16+
--no-install-recommends clang
17+
- run:
18+
name: Create VFB for Atom to run in
19+
command: /usr/local/bin/xvfb_start
20+
- run:
21+
name: Atom version
22+
command: ${ATOM_SCRIPT_PATH} --version
23+
- run:
24+
name: APM version
25+
command: ${APM_SCRIPT_PATH} --version
26+
- run:
27+
name: Package APM package dependencies
28+
command: |
29+
if [ -n "${APM_TEST_PACKAGES}" ]; then
30+
for pack in ${APM_TEST_PACKAGES}; do
31+
${APM_SCRIPT_PATH} install "${pack}"
32+
done
33+
fi;
34+
- run:
35+
name: Package dependencies
36+
command: ${APM_SCRIPT_PATH} install
37+
- run:
38+
name: Cleaning package
39+
command: ${APM_SCRIPT_PATH} clean
40+
- run:
41+
name: Package specs
42+
command: ${ATOM_SCRIPT_PATH} --test spec
43+
# Cache node_modules
44+
- save_cache:
45+
paths:
46+
- node_modules
47+
key: v3-dependencies-{{ .Branch }}-{{ checksum "package.json" }}-{{ checksum "package-lock.json"}}
1148

1249
jobs:
1350
checkout_code:
1451
<<: *defaults
52+
docker:
53+
- image: circleci/node:latest
1554
steps:
1655
- checkout
17-
- run:
18-
name: Download Atom test script
19-
command: curl -s -O https://raw.githubusercontent.com/atom/ci/master/build-package.sh
20-
- run:
21-
name: Make Atom script executable
22-
command: chmod u+x build-package.sh
2356
# Restore node_modules from the last build
2457
- restore_cache:
2558
keys:
26-
# Get latest cache for this package.json
27-
- v2-dependencies-{{ checksum "package.json" }}
28-
# Fallback to the last available cache
29-
- v2-dependencies
59+
# Get latest cache for this package.json and package-lock.json
60+
- v3-dependencies-{{ .Branch }}-{{ checksum "package.json" }}-{{ checksum "package-lock.json"}}
61+
# Fallback to the current package.json
62+
- v3-dependencies-{{ .Branch }}-{{ checksum "package.json" }}-
63+
# Fallback to the last build for this branch
64+
- v3-dependencies-{{ .Branch }}-
65+
# Fallback to the last available master branch cache
66+
- v3-dependencies-master-
67+
# Don't go further down to prevent dependency issues from other branches
3068
# Save project state for next steps
3169
- persist_to_workspace:
3270
root: /tmp
3371
paths:
3472
- project
35-
36-
stable:
73+
lint:
3774
<<: *defaults
75+
docker:
76+
- image: circleci/node:latest
3877
steps:
3978
# Restore project state
4079
- attach_workspace:
4180
at: /tmp
4281
- run:
43-
name: Update APT
44-
command: apt-get update
45-
# Install some pre-requisite packages and missing dependencies from the atom package
82+
name: Node.js Version
83+
command: node --version
4684
- run:
47-
name: Atom Prerequisites
48-
command: apt-get --assume-yes --quiet --no-install-suggests --no-install-recommends install sudo xvfb libxss1 libasound2
49-
# Fire up a VFB to run Atom in
85+
name: NPM Version
86+
command: npm --version
5087
- run:
51-
name: Create VFB for Atom to run in
52-
command: /usr/bin/Xvfb $DISPLAY -ac -screen 0 1280x1024x16
53-
background: true
88+
name: Install any remaining dependencies
89+
command: npm install
5490
- run:
55-
name: Atom test
56-
command: ./build-package.sh
57-
# Cache node_modules
58-
- save_cache:
59-
paths:
60-
- node_modules
61-
key: v2-dependencies-{{ checksum "package.json" }}
62-
91+
name: Lint code
92+
command: npm run lint
93+
stable:
94+
<<: *defaults
6395
beta:
6496
<<: *defaults
65-
environment:
66-
ATOM_CHANNEL: beta
67-
steps:
68-
# Restore project state
69-
- attach_workspace:
70-
at: /tmp
71-
- run:
72-
name: Update APT
73-
command: apt-get update
74-
# Install some pre-requisite packages and missing dependencies from the atom package
75-
- run:
76-
name: Atom Prerequisites
77-
command: apt-get --assume-yes --quiet --no-install-suggests --no-install-recommends install sudo xvfb libxss1 libasound2
78-
# Fire up a VFB to run Atom in
79-
- run:
80-
name: Create VFB for Atom to run in
81-
command: /usr/bin/Xvfb $DISPLAY -ac -screen 0 1280x1024x16
82-
background: true
83-
- run:
84-
name: Atom test
85-
command: ./build-package.sh
97+
docker:
98+
- image: arcanemagus/atom-docker-ci:beta
8699

87100
workflows:
88101
version: 2
89102
test_package:
90103
jobs:
91104
- checkout_code
92-
- stable:
105+
- lint:
93106
requires:
94107
- checkout_code
108+
- stable:
109+
requires:
110+
- lint
95111
- beta:
96112
requires:
97-
- checkout_code
113+
- lint

0 commit comments

Comments
 (0)