Skip to content

Circle ci #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 28 commits into from
May 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
737b7ee
build(submodule): add submodule
amejiarosario May 8, 2019
f7fcd7e
build(submodule): bump commit
amejiarosario May 8, 2019
66a445d
chore(submodules): pull all submodules
amejiarosario May 8, 2019
29adcad
chore: bump subproject
amejiarosario May 8, 2019
1f69dc8
build(circleci): added config
amejiarosario May 8, 2019
957aa8c
build: remove travis-ci
amejiarosario May 8, 2019
7b7782d
build: add book creation
amejiarosario May 8, 2019
0389a4b
build: run 2 jobs
amejiarosario May 8, 2019
19ef4a5
build: fix fingerprint
amejiarosario May 8, 2019
7c0d089
build: fix path
amejiarosario May 8, 2019
689fd1a
build: fix mathematical issue
amejiarosario May 9, 2019
6b12e30
build: last try
amejiarosario May 9, 2019
5204fb2
build: cmake
amejiarosario May 9, 2019
4bdd5f4
build: GraphicsMagick
amejiarosario May 9, 2019
30b6c5f
build: software-properties-common
amejiarosario May 9, 2019
cc13f66
build: graphicsmagick fix
amejiarosario May 9, 2019
406fae7
build: fix links and images
amejiarosario May 9, 2019
47dbd64
no GraphicsMagick
amejiarosario May 9, 2019
732cf6f
install deps for GraphicsMagick
amejiarosario May 9, 2019
6a4dc4d
build: silent install
amejiarosario May 9, 2019
3a69aaa
artifacts
amejiarosario May 9, 2019
3540798
build: bundle exec
amejiarosario May 9, 2019
3ac9bde
build: artifacts path fix
amejiarosario May 9, 2019
0aa777a
build: set destination
amejiarosario May 9, 2019
47438eb
build: improve cache
amejiarosario May 9, 2019
4dc6e43
build: add parenthesis
amejiarosario May 9, 2019
efb2c7d
build: npm_package_version
amejiarosario May 9, 2019
ef7a0f3
build: shows node version
amejiarosario May 9, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# Use the latest 2.1 version of CircleCI pipeline processing engine, see https://circleci.com/docs/2.0/configuration-reference/
version: 2 # use CircleCI 2.0
jobs: # a collection of steps
build: # runs not using Workflows must have a `build` job as entry point
docker: # run the steps with Docker
- image: circleci/node:lts # ...with this image as the primary container; this is where all `steps` will run
steps:
- checkout
- run:
name: update-npm
command: 'sudo npm install -g npm@latest'
- run:
name: node version
command: node -v
- run:
name: NPM version
command: npm -v

- restore_cache: # special step to restore the dependency cache
# Read about caching dependencies: https://circleci.com/docs/2.0/caching/
keys:
# Find a cache corresponding to this specific package-lock.json checksum
- npm-package-{{ checksum "package-lock.json" }}
# Find the most recently generated cache used from any branch
- npm-package-
- run:
name: npm install
command: npm install

- save_cache: # special step to save the dependency cache
key: npm-package-{{ checksum "package-lock.json" }}
paths:
- ./node_modules

- run: # run tests
name: run tests
command: npm run ci

- store_artifacts: # special step to save test results as as artifact
# Upload test summary for display in Artifacts: https://circleci.com/docs/2.0/artifacts/
path: test-results.xml
prefix: tests
- store_artifacts: # for display in Artifacts: https://circleci.com/docs/2.0/artifacts/
path: coverage
prefix: coverage
- store_test_results: # for display in Test Summary: https://circleci.com/docs/2.0/collect-test-data/
path: test-results.xml

docs:
docker:
- image: circleci/ruby:2.5.3-stretch-node
environment:
NOKOGIRI_USE_SYSTEM_LIBRARIES: true
steps:
- add_ssh_keys:
fingerprints:
- "b5:40:36:ee:3c:52:25:dd:c7:41:f3:10:d1:ce:f9:33"
- checkout
- run:
name: checkout repo and submodules
command: git submodule update --init --recursive
- run:
name: bundler version
command: bundle -v
- run:
name: ruby version
command: ruby -v
- run:
name: node version
command: node -v
- run:
name: NPM version
command: npm -v

# Restore bundle cache
- restore_cache:
keys:
- gemfile-cache-{{ checksum "book/config/Gemfile.lock" }}
- gemfile-cache-

- run:
name: Bundle Install.pre - install mathematical for 'asciidoctor-mathematical' gem
command: cd book/config && bundle check --path vendor/bundle || ( sudo apt-get update && sudo apt-get -qq -y install cmake bison flex libffi-dev libxml2-dev libgdk-pixbuf2.0-dev libcairo2-dev libpango1.0-dev ttf-lyx )

- run:
name: Bundle Install.pre - install GraphicsMagick for 'prawn-gmagick' gem
command: cd book/config && bundle check --path vendor/bundle || ( sudo apt-get -qq -y install graphicsmagick-imagemagick-compat graphicsmagick-libmagick-dev-compat )

- run:
name: Bundle Install
command: cd book/config && bundle check --path vendor/bundle || ( bundle install --path vendor/bundle )

# Store bundle cache
- save_cache:
key: gemfile-cache-{{ checksum "book/config/Gemfile.lock" }}
paths:
- book/config/vendor/bundle

- run:
name: graphviz for dot diagrams
command: sudo apt-get -qq -y install graphviz

- run:
name: generate PDF
command: cd book/config && make VERSION="$(npx -c 'echo "$npm_package_version"')" pdf

- store_artifacts:
path: book/dist
destination: book

workflows:
version: 2
build_and_docs:
jobs:
- build
- docs
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ coverage
dist
_book
.DS_Store
.asciidoctor
.asciidoctor/

# https://raw.githubusercontent.com/mraible/infoq-mini-book/master/.gitignore
######################
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "book/config"]
path = book/config
url = [email protected]:amejiarosario/dsa.js-private.git
5 changes: 0 additions & 5 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Data Structures and Algorithms in JavaScript

[![Build Status](https://travis-ci.com/amejiarosario/dsa.js.svg?branch=master)](https://travis-ci.com/amejiarosario/dsa.js) [![NPM version](https://badge.fury.io/js/dsa.js.svg)](https://badge.fury.io/js/dsa.js) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com) [![Code Style Airbnb](https://img.shields.io/badge/code%20style-Airbnb-brightgreen.svg)](https://github.com/airbnb/javascript)
[![CircleCI](https://circleci.com/gh/amejiarosario/dsa.js.svg?style=svg)](https://circleci.com/gh/amejiarosario/dsa.js) [![NPM version](https://badge.fury.io/js/dsa.js.svg)](https://badge.fury.io/js/dsa.js) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com) [![Code Style Airbnb](https://img.shields.io/badge/code%20style-Airbnb-brightgreen.svg)](https://github.com/airbnb/javascript)
[![ProductHunt](https://img.shields.io/badge/product%20hunt-vote-orange.svg)](https://www.producthunt.com/posts/dsa-js)

Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The `partition` function does the real heavy-lifting. 🏋️‍♀️
.Quicksort implementation in JavaScript (partition)
[source, javascript]
----
include::{codedir}/algorithms/sorting/Quick-sort.js[tag=partition, indent=0]
include::{codedir}/algorithms/sorting/quick-sort.js[tag=partition, indent=0]
----
<1> Take the leftmost element as the pivot.
<2> `pivotFinalIndex` is the placeholder for the final position where the pivot will be placed when the array is sorted.
Expand All @@ -59,7 +59,7 @@ If instead of partitioning by the first element we do it by the middle (or even

[source, javascript]
----
include::{codedir}/algorithms/sorting/Quick-sort.js[tag=sort, indent=0]
include::{codedir}/algorithms/sorting/quick-sort.js[tag=sort, indent=0]
----
<1> Convert to array (or clone array). If you want to modify the input directly remove this line.
<2> Shuffle array to avoid edge cases (desc order arrays)
Expand Down
1 change: 1 addition & 0 deletions book/config
Submodule config added at ca372d
Binary file modified book/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"watch": "jest src/ --watch --coverage",
"coverage": "jest src/ --coverage && open coverage/lcov-report/index.html",
"lint": "npx eslint --fix --format codeframe src/",
"ci": "npx eslint src/ && npm test"
"ci": "npx eslint src/ && jest src/ --coverage"
},
"keywords": [
"algorithms",
Expand Down