Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 7cff9ab

Browse files
committed
init
some edit attempt to fix yaml syntax error add job added more config fix syntax error syntax error start postgres use postgres in services fix syntax error removed start script add user set user to runner create user add missing quote add .env variable another attempt use macos image use linux revert to mac image attempt to disable gpu
1 parent 4e61bc9 commit 7cff9ab

File tree

3 files changed

+245
-41
lines changed

3 files changed

+245
-41
lines changed

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: ci
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
services:
9+
postgres:
10+
image: postgres
11+
env:
12+
POSTGRES_USER: postgres
13+
POSTGRES_PASSWORD: postgres
14+
options: >-
15+
--health-cmd pg_isready
16+
--health-interval 10s
17+
--health-timeout 5s
18+
--health-retries 5
19+
ports:
20+
- 5432:5432
21+
strategy:
22+
matrix:
23+
ATOM_CHANNEL: ['stable','beta','dev']
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v2
27+
- name: Setup node
28+
uses: actions/setup-node@v2
29+
with:
30+
node-version: '12'
31+
- name: Create DB
32+
run: |
33+
sudo service postgresql start
34+
sudo su postgres -c 'createuser -P --superuser runner'
35+
createdb teletype-test
36+
- name: Build Atom
37+
env:
38+
TRAVIS_OS_NAME: 'linux'
39+
run: |
40+
chmod u+x bash.sh
41+
./bash.sh

.travis.yml

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

bash.sh

Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
#!/bin/sh
2+
3+
ATOM_CHANNEL="${ATOM_CHANNEL:=stable}"
4+
5+
echo "Downloading latest Atom release on the ${ATOM_CHANNEL} channel..."
6+
if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
7+
curl -s -L "https://atom.io/download/mac?channel=${ATOM_CHANNEL}" \
8+
-H 'Accept: application/octet-stream' \
9+
-o "atom.zip"
10+
mkdir atom
11+
unzip -q atom.zip -d atom
12+
if [ "${ATOM_CHANNEL}" = "stable" ]; then
13+
export ATOM_APP_NAME="Atom.app"
14+
export ATOM_SCRIPT_NAME="atom.sh"
15+
export ATOM_SCRIPT_PATH="./atom/${ATOM_APP_NAME}/Contents/Resources/app/atom.sh"
16+
else
17+
export ATOM_APP_NAME="Atom ${ATOM_CHANNEL}.app"
18+
export ATOM_SCRIPT_NAME="atom-${ATOM_CHANNEL}"
19+
export ATOM_SCRIPT_PATH="./atom-${ATOM_CHANNEL}"
20+
ln -s "./atom/${ATOM_APP_NAME}/Contents/Resources/app/atom.sh" "${ATOM_SCRIPT_PATH}"
21+
fi
22+
export ATOM_PATH="./atom"
23+
export APM_SCRIPT_PATH="./atom/${ATOM_APP_NAME}/Contents/Resources/app/apm/node_modules/.bin/apm"
24+
export NPM_SCRIPT_PATH="./atom/${ATOM_APP_NAME}/Contents/Resources/app/apm/node_modules/.bin/npm"
25+
export PATH="${PATH}:${TRAVIS_BUILD_DIR}/atom/${ATOM_APP_NAME}/Contents/Resources/app/apm/node_modules/.bin"
26+
elif [ "${TRAVIS_OS_NAME}" = "linux" ]; then
27+
curl -s -L "https://atom.io/download/deb?channel=${ATOM_CHANNEL}" \
28+
-H 'Accept: application/octet-stream' \
29+
-o "atom-amd64.deb"
30+
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16
31+
export DISPLAY=":99"
32+
dpkg-deb -x atom-amd64.deb "${HOME}/atom"
33+
if [ "${ATOM_CHANNEL}" = "stable" ]; then
34+
export ATOM_SCRIPT_NAME="atom"
35+
export APM_SCRIPT_NAME="apm"
36+
else
37+
export ATOM_SCRIPT_NAME="atom-${ATOM_CHANNEL}"
38+
export APM_SCRIPT_NAME="apm-${ATOM_CHANNEL}"
39+
fi
40+
export ATOM_SCRIPT_PATH="${HOME}/atom/usr/bin/${ATOM_SCRIPT_NAME}"
41+
export APM_SCRIPT_PATH="${HOME}/atom/usr/bin/${APM_SCRIPT_NAME}"
42+
export NPM_SCRIPT_PATH="${HOME}/atom/usr/share/${ATOM_SCRIPT_NAME}/resources/app/apm/node_modules/.bin/npm"
43+
export PATH="${PATH}:${HOME}/atom/usr/bin"
44+
elif [ "${CIRCLECI}" = "true" ]; then
45+
case "${CIRCLE_BUILD_IMAGE}" in
46+
osx)
47+
curl -s -L "https://atom.io/download/mac?channel=${ATOM_CHANNEL}" \
48+
-H 'Accept: application/octet-stream' \
49+
-o "atom.zip"
50+
mkdir -p /tmp/atom
51+
unzip -q atom.zip -d /tmp/atom
52+
if [ "${ATOM_CHANNEL}" = "stable" ]; then
53+
export ATOM_APP_NAME="Atom.app"
54+
export ATOM_SCRIPT_NAME="atom.sh"
55+
export ATOM_SCRIPT_PATH="/tmp/atom/${ATOM_APP_NAME}/Contents/Resources/app/atom.sh"
56+
else
57+
export ATOM_APP_NAME="Atom ${ATOM_CHANNEL}.app"
58+
export ATOM_SCRIPT_NAME="atom-${ATOM_CHANNEL}"
59+
export ATOM_SCRIPT_PATH="/tmp/atom-${ATOM_CHANNEL}"
60+
ln -s "/tmp/atom/${ATOM_APP_NAME}/Contents/Resources/app/atom.sh" "${ATOM_SCRIPT_PATH}"
61+
fi
62+
export ATOM_PATH="/tmp/atom"
63+
export APM_SCRIPT_PATH="/tmp/atom/${ATOM_APP_NAME}/Contents/Resources/app/apm/node_modules/.bin/apm"
64+
export NPM_SCRIPT_PATH="/tmp/atom/${ATOM_APP_NAME}/Contents/Resources/app/apm/node_modules/.bin/npm"
65+
export PATH="${PATH}:${TRAVIS_BUILD_DIR}/atom/${ATOM_APP_NAME}/Contents/Resources/app/apm/node_modules/.bin"
66+
67+
# Clear screen saver
68+
osascript -e 'tell application "System Events" to keystroke "x"'
69+
;;
70+
*)
71+
# Assume the build is on a Debian based image (Circle CI provided Linux images)
72+
curl -s -L "https://atom.io/download/deb?channel=${ATOM_CHANNEL}" \
73+
-H 'Accept: application/octet-stream' \
74+
-o "atom-amd64.deb"
75+
sudo dpkg --install atom-amd64.deb || true
76+
sudo apt-get update
77+
sudo apt-get --fix-broken --assume-yes --quiet install
78+
if [ "${ATOM_CHANNEL}" = "stable" ] || [ "${ATOM_CHANNEL}" = "dev" ]; then
79+
export ATOM_SCRIPT_PATH="atom"
80+
export APM_SCRIPT_PATH="apm"
81+
else
82+
export ATOM_SCRIPT_PATH="atom-${ATOM_CHANNEL}"
83+
export APM_SCRIPT_PATH="apm-${ATOM_CHANNEL}"
84+
fi
85+
export NPM_SCRIPT_PATH="/usr/share/atom/resources/app/apm/node_modules/.bin/npm"
86+
;;
87+
esac
88+
else
89+
echo "Unknown CI environment, exiting!"
90+
exit 1
91+
fi
92+
93+
echo "Using Atom version:"
94+
"${ATOM_SCRIPT_PATH}" -v
95+
echo "Using APM version:"
96+
"${APM_SCRIPT_PATH}" -v
97+
98+
echo "Downloading package dependencies..."
99+
100+
if [ "${ATOM_LINT_WITH_BUNDLED_NODE:=true}" = "true" ]; then
101+
if [ -f "package-lock.json" ]; then
102+
"${APM_SCRIPT_PATH}" ci
103+
else
104+
echo "Warning: package-lock.json not found; running apm install instead of apm ci"
105+
"${APM_SCRIPT_PATH}" install
106+
"${APM_SCRIPT_PATH}" clean
107+
fi
108+
109+
# Override the PATH to put the Node bundled with APM first
110+
if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
111+
export PATH="./atom/${ATOM_APP_NAME}/Contents/Resources/app/apm/bin:${PATH}"
112+
elif [ "${CIRCLECI}" = "true" ] && [ "${CIRCLE_BUILD_IMAGE}" = "osx" ]; then
113+
export PATH="/tmp/atom/${ATOM_APP_NAME}/Contents/Resources/app/apm/bin:${PATH}"
114+
elif [ "${CIRCLECI}" = "true" ]; then
115+
# Since CircleCI/Linux is a fully installed environment, we use the system path to apm
116+
export PATH="/usr/share/atom/resources/app/apm/bin:${PATH}"
117+
else
118+
export PATH="${HOME}/atom/usr/share/${ATOM_SCRIPT_NAME}/resources/app/apm/bin:${PATH}"
119+
fi
120+
else
121+
export NPM_SCRIPT_PATH="npm"
122+
if [ -f "package-lock.json" ]; then
123+
"${APM_SCRIPT_PATH}" ci --production
124+
else
125+
echo "Warning: package-lock.json not found; running apm install instead of apm ci"
126+
"${APM_SCRIPT_PATH}" install --production
127+
"${APM_SCRIPT_PATH}" clean
128+
fi
129+
130+
# Use the system NPM to install the devDependencies
131+
echo "Using Node version:"
132+
node --version
133+
echo "Using NPM version:"
134+
npm --version
135+
echo "Installing remaining dependencies..."
136+
npm install
137+
fi
138+
139+
if [ -n "${APM_TEST_PACKAGES}" ]; then
140+
echo "Installing atom package dependencies..."
141+
for pack in ${APM_TEST_PACKAGES}; do
142+
"${APM_SCRIPT_PATH}" install "${pack}"
143+
done
144+
fi
145+
146+
has_linter() {
147+
${NPM_SCRIPT_PATH} ls --parseable --dev --depth=0 "$1" 2> /dev/null | grep -q "$1$"
148+
}
149+
150+
if has_linter "coffeelint"; then
151+
if [ -d ./lib ]; then
152+
echo "Linting package using coffeelint..."
153+
./node_modules/.bin/coffeelint lib
154+
rc=$?; if [ $rc -ne 0 ]; then exit $rc; fi
155+
fi
156+
if [ -d ./spec ]; then
157+
echo "Linting package specs using coffeelint..."
158+
./node_modules/.bin/coffeelint spec
159+
rc=$?; if [ $rc -ne 0 ]; then exit $rc; fi
160+
fi
161+
fi
162+
163+
if has_linter "eslint"; then
164+
if [ -d ./lib ]; then
165+
echo "Linting package using eslint..."
166+
./node_modules/.bin/eslint lib
167+
rc=$?; if [ $rc -ne 0 ]; then exit $rc; fi
168+
fi
169+
if [ -d ./spec ]; then
170+
echo "Linting package specs using eslint..."
171+
./node_modules/.bin/eslint spec
172+
rc=$?; if [ $rc -ne 0 ]; then exit $rc; fi
173+
fi
174+
fi
175+
176+
if has_linter "standard"; then
177+
if [ -d ./lib ]; then
178+
echo "Linting package using standard..."
179+
./node_modules/.bin/standard "lib/**/*.js"
180+
rc=$?; if [ $rc -ne 0 ]; then exit $rc; fi
181+
fi
182+
if [ -d ./spec ]; then
183+
echo "Linting package specs using standard..."
184+
./node_modules/.bin/standard "spec/**/*.js"
185+
rc=$?; if [ $rc -ne 0 ]; then exit $rc; fi
186+
fi
187+
if [ -d ./test ]; then
188+
echo "Linting package tests using standard..."
189+
./node_modules/.bin/standard "test/**/*.js"
190+
rc=$?; if [ $rc -ne 0 ]; then exit $rc; fi
191+
fi
192+
fi
193+
194+
if [ -d ./spec ]; then
195+
echo "Running specs..."
196+
"${ATOM_SCRIPT_PATH}" --test spec --disable-gpu
197+
elif [ -d ./test ]; then
198+
echo "Running specs..."
199+
"${ATOM_SCRIPT_PATH}" --test test --disable-gpu
200+
else
201+
echo "Missing spec folder! Please consider adding a test suite in './spec' or in './test'"
202+
exit 0
203+
fi
204+
exit

0 commit comments

Comments
 (0)