Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into fix-timer-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nd4p90x committed Jul 28, 2021
2 parents ba2343d + b13490a commit 87882f1
Show file tree
Hide file tree
Showing 16 changed files with 8,898 additions and 330 deletions.
24 changes: 24 additions & 0 deletions .buildscript/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

if ! which brew >/dev/null; then
echo "homebrew is not available. Install it from http://brew.sh"
exit 1
else
echo "homebrew already installed"
fi

if ! which node >/dev/null; then
echo "installing node..."
brew install node
else
echo "node already installed"
fi

if ! which yarn >/dev/null; then
echo "installing yarn..."
brew install yarn
else
echo "yarn already installed"
fi

echo "all dependencies installed."
7 changes: 7 additions & 0 deletions .buildscript/circle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

if ! eMSG=$(circleci config validate -c .circleci/config.yml); then
echo "CircleCI Configuration Failed Validation."
echo $eMSG
exit 1
fi
13 changes: 13 additions & 0 deletions .buildscript/e2e.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

set -e

if [ "$RUN_E2E_TESTS" != "true" ]; then
echo "Skipping end to end tests."
else
echo "Running end to end tests..."
wget https://github.com/segmentio/library-e2e-tester/releases/download/0.3.2/tester_linux_amd64 -O tester
chmod +x tester
./tester -path='./cli.js' -concurrency=3
echo "End to end tests completed!"
fi
109 changes: 109 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
workflows:
version: 2
validate-config:
jobs:
- circle-lint
multi-test:
jobs:
- test-node10
- test-node12
test_and_publish:
jobs:
- test:
filters:
tags:
only: /.*/
- publish:
context: npm
requires:
- test
filters:
tags:
only: /v[0-9]+(\.[0-9]+)*(-.+)?/
branches:
ignore: /.*/
static_analysis:
jobs:
- test
- coverage:
requires:
- test
- snyk:
context: snyk
requires:
- test
scheduled_e2e_test:
triggers:
- schedule:
cron: "15 * * * *"
filters:
branches:
only:
- master
- scheduled_e2e_testing
jobs:
- test-node10
- test-node12

version: 2
jobs:
circle-lint:
working_directory: ~/analytics-node
docker:
- image: node
steps:
- checkout
- run: yarn run circle-lint
node-base-test: &node-base-test
working_directory: ~/analytics-node
docker:
- image: node
steps:
- checkout
- restore_cache:
key: yarn-dependency-cache-{{ checksum "yarn.lock" }}
- run: yarn install --frozen-lockfile
- save_cache:
key: yarn-dependency-cache-{{ checksum "yarn.lock" }}
paths:
- node_modules
- run: yarn test
- persist_to_workspace:
root: .
paths: [.]

test-node10:
<<: *node-base-test
docker:
- image: circleci/node:10-browsers
test-node12:
<<: *node-base-test
docker:
- image: circleci/node:12-browsers
test:
<<: *node-base-test
docker:
- image: circleci/node:10-browsers
coverage:
docker:
- image: circleci/node:10-browsers
steps:
- checkout
- attach_workspace: { at: . }
- run: yarn run report-coverage
snyk:
docker:
- image: circleci/node:10-browsers
steps:
- checkout
- attach_workspace: { at: . }
- run: yarn run snyk test --severity-threshold=high
- run: yarn run snyk monitor
publish:
docker:
- image: circleci/node:10-browsers
steps:
- checkout
- attach_workspace: { at: . }
- run: npm config set "//registry.npmjs.org/:_authToken" $NPM_AUTH
- run: npm publish .
12 changes: 12 additions & 0 deletions .huskyrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const tasks = arr => arr.join(' && ')
module.exports = {
'hooks': {
'pre-commit': tasks([
'exec < /dev/tty',
`if ! [ -x "$(command -v circleci)" ]; then
echo "If you want to verify your circleci config precommit, please install the local circleci tool from https://circleci.com/docs/2.0/local-cli/"; else
yarn run circle-lint
fi`
])
}
}

0 comments on commit 87882f1

Please sign in to comment.