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

Commit 44c15c5

Browse files
authored
Merge pull request #153 from AtomLinter/arcanemagus/circleci-2.0
Upgrade to CircleCI 2.0
2 parents 6aeab9d + 4c11802 commit 44c15c5

File tree

2 files changed

+122
-18
lines changed

2 files changed

+122
-18
lines changed

.circleci/config.yml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
version: 2
2+
3+
defaults: &defaults
4+
working_directory: /tmp/project
5+
docker:
6+
- image: arcanemagus/atom-docker-ci:stable
7+
environment:
8+
APM_TEST_PACKAGES: "language-puppet"
9+
steps:
10+
# Restore project state
11+
- attach_workspace:
12+
at: /tmp
13+
- run:
14+
name: Install Ruby
15+
command: |
16+
sudo apt-get update &&
17+
sudo apt-get install --assume-yes --quiet --no-install-suggests \
18+
--no-install-recommends ruby
19+
- run:
20+
name: Ruby version
21+
command: ruby --version
22+
- run:
23+
name: Update gem
24+
command: sudo gem update --system --no-document
25+
- run:
26+
name: Install puppet-lint
27+
command: sudo gem install puppet-lint --no-document
28+
- run:
29+
name: Create VFB for Atom to run in
30+
command: /usr/local/bin/xvfb_start
31+
- run:
32+
name: Atom version
33+
command: ${ATOM_SCRIPT_PATH} --version
34+
- run:
35+
name: APM version
36+
command: ${APM_SCRIPT_PATH} --version
37+
- run:
38+
name: puppet-lint version
39+
command: puppet-lint --version
40+
- run:
41+
name: Cleaning package
42+
command: ${APM_SCRIPT_PATH} clean
43+
- run:
44+
name: Package APM package dependencies
45+
command: |
46+
if [ -n "${APM_TEST_PACKAGES}" ]; then
47+
for pack in ${APM_TEST_PACKAGES}; do
48+
${APM_SCRIPT_PATH} install "${pack}"
49+
done
50+
fi;
51+
- run:
52+
name: Package dependencies
53+
command: ${APM_SCRIPT_PATH} install
54+
- run:
55+
name: Package specs
56+
command: ${ATOM_SCRIPT_PATH} --test spec
57+
# Cache node_modules
58+
- save_cache:
59+
paths:
60+
- node_modules
61+
key: v1-dependencies-{{ checksum "package.json" }}
62+
63+
jobs:
64+
checkout_code:
65+
<<: *defaults
66+
docker:
67+
- image: circleci/node:latest
68+
steps:
69+
- checkout
70+
# Restore node_modules from the last build
71+
- restore_cache:
72+
keys:
73+
# Get latest cache for this package.json
74+
- v1-dependencies-{{ checksum "package.json" }}
75+
# Fallback to the last available cache
76+
- v1-dependencies
77+
# Save project state for next steps
78+
- persist_to_workspace:
79+
root: /tmp
80+
paths:
81+
- project
82+
lint:
83+
<<: *defaults
84+
docker:
85+
- image: circleci/node:latest
86+
steps:
87+
# Restore project state
88+
- attach_workspace:
89+
at: /tmp
90+
- run:
91+
name: Node.js Version
92+
command: node --version
93+
- run:
94+
name: NPM Version
95+
command: npm --version
96+
- run:
97+
name: Install any remaining dependencies
98+
command: npm install
99+
- run:
100+
name: Lint code
101+
command: npm run lint
102+
stable:
103+
<<: *defaults
104+
beta:
105+
<<: *defaults
106+
docker:
107+
- image: arcanemagus/atom-docker-ci:beta
108+
109+
workflows:
110+
version: 2
111+
test_package:
112+
jobs:
113+
- checkout_code
114+
- lint:
115+
requires:
116+
- checkout_code
117+
- stable:
118+
requires:
119+
- lint
120+
- beta:
121+
requires:
122+
- lint

circle.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)