Skip to content

Commit

Permalink
Integrate CircleCI (#131)
Browse files Browse the repository at this point in the history
* Integrate CircleCI
  • Loading branch information
manuel-jasso authored Nov 17, 2020
1 parent e093810 commit 6c6c092
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 1 deletion.
82 changes: 82 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Environment configuration
# =========================

env_default: &env_default
working_directory: ~/near-membrane
docker:
- image: circleci/node:14-browsers


# Commands definitions
# ====================

# Yarn cache
restore_yarn_cache: &restore_yarn_cache
restore_cache:
keys:
- yarn-v4-{{ checksum "yarn.lock" }}

save_yarn_cache: &save_yarn_cache
save_cache:
key: yarn-v4-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn

# Workspace
save_workspace: &save_workspace
persist_to_workspace:
root: .
paths: .

load_workspace: &load_workspace
attach_workspace:
at: ~/tmp/workspace

# Build
install: &install
run:
name: Install and build
command: |
yarn install --frozen-lockfile
yarn build
# Jest tests
run_unit_tests: &run_unit_tests
run:
name: Run Jest tests
command: yarn test

# Karma tests
run_karma_tests: &run_karma_tests
run:
name: Run Karma tests
command: npx karma start karma.config.js --single-run --browsers FirefoxHeadless


# Jobs definition
# ===============

version: 2
jobs:
build:
<<: *env_default
steps:
- checkout

- *restore_yarn_cache
- *install
- *save_yarn_cache
- *save_workspace

- *run_unit_tests
- *run_karma_tests


# Workflows definition
# ====================

workflows:
version: 2
build_and_test:
jobs:
- build
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@locker/near-membrane",
"version": "0.3.4",
"version": "0.4.0",
"description": "JavaScript Near Membrane Library to create a sandboxed environment",
"module": "lib/index.js",
"types": "types/index.js",
Expand Down

0 comments on commit 6c6c092

Please sign in to comment.