Skip to content

Commit

Permalink
fix: ran generator
Browse files Browse the repository at this point in the history
  • Loading branch information
dxcli committed Jan 16, 2018
1 parent 4bb6fc0 commit 77aff3b
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 29 deletions.
5 changes: 2 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- v0-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum "scripts/circleci"}}-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-{{checksum "yarn.lock"}}
- v0-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum "scripts/circleci"}}-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-
- v0-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum "scripts/circleci"}}-{{checksum ".circleci/config.yml"}}-master-
- run: ./scripts/circleci
- run: ./scripts/circleci test
- store_test_results:
path: ~/cli/reports
- save_cache: &save_cache
Expand All @@ -30,8 +30,7 @@ jobs:
steps:
- checkout
- restore_cache: *restore_cache
- run: yarn
- run: ./node_modules/.bin/dxcli-dev-semantic-release
- run: ./scripts/circleci release
- save_cache: *save_cache

workflows:
Expand Down
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
* text=auto
*.js text eol=lf
*.ts text eol=lf
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
*-debug.log
*-error.log
/.nyc_output
/coverage
/coverage.lcov
/lib
/node_modules
/tmp
/lib
/.nyc_output
4 changes: 3 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ environment:
nodejs_version: "9"
cache:
- '%LOCALAPPDATA%\Yarn -> appveyor.yml'
- node_modules -> package.json
- node_modules -> yarn.lock

install:
- ps: Install-Product node $env:nodejs_version x64
- git config --global user.email "[email protected]"
- git config --global user.name "dxcli"
- yarn
test_script:
- yarn test
Expand Down
74 changes: 51 additions & 23 deletions scripts/circleci
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,61 @@

set -ex

duration() {
set +x
start=$(date +%s)
"$@"
end=$(date +%s)
python -c "print 'Ran $1 in %u:%02u' % ((${end} - ${start})/60, (${end} - ${start})%60)"
set -x
}

PATH=/usr/local/share/.config/yarn/global/node_modules/.bin:$PATH

CLI_ENGINE_UTIL_YARN_ARGS="--frozen-lockfile"
if [[ ! -z "$GIT_EMAIL" ]] & [[ ! -z "$GIT_USERNAME" ]]; then
git config --global push.default simple
git config --global user.email "$GIT_EMAIL"
git config --global user.user "$GIT_USERNAME"
fi

_test() {
CLI_ENGINE_UTIL_YARN_ARGS="--frozen-lockfile"

if [[ "$CIRCLE_BRANCH" == greenkeeper/* ]]; then
CLI_ENGINE_GREENKEEPER_BRANCH=1
CLI_ENGINE_UTIL_YARN_ARGS=""
if [[ ! -x "$(command -v greenkeeper-lockfile-update)" ]]; then
yarn global add greenkeeper-lockfile@1
if [[ "$CIRCLE_BRANCH" == greenkeeper/* ]]; then
CLI_ENGINE_GREENKEEPER_BRANCH=1
CLI_ENGINE_UTIL_YARN_ARGS=""
if [[ ! -x "$(command -v greenkeeper-lockfile-update)" ]]; then
duration yarn global add greenkeeper-lockfile@1
fi
duration greenkeeper-lockfile-update
fi
greenkeeper-lockfile-update
fi

yarn install $CLI_ENGINE_UTIL_YARN_ARGS
duration yarn install $CLI_ENGINE_UTIL_YARN_ARGS

if [[ "$CLI_ENGINE_GREENKEEPER_BRANCH" == 1 ]]; then
greenkeeper-lockfile-upload
fi
if [[ "$CLI_ENGINE_GREENKEEPER_BRANCH" == 1 ]]; then
duration greenkeeper-lockfile-upload
fi

CWD=$(pwd)
NYC="./node_modules/.bin/nyc --nycrc-path node_modules/@dxcli/dev-nyc-config/.nycrc"
mkdir -p reports
MOCHA_FILE="$CWD/reports/mocha.xml" \
DXCLI_MOCHA_OPTS="--reporter mocha-junit-reporter" \
DXCLI_ESLINT_OPTS="--format junit --output-file $CWD/reports/eslint.xml" \
DXCLI_TSLINT_OPTS="--format junit > $CWD/reports/tslint.xml" \
$NYC yarn test
$NYC report --reporter=text-lcov > coverage.lcov

curl -s https://codecov.io/bash | bash
CWD=$(pwd)
NYC=(./node_modules/.bin/nyc --nycrc-path node_modules/@dxcli/dev-nyc-config/.nycrc)
mkdir -p reports
MOCHA_FILE="$CWD/reports/mocha.xml" \
DXCLI_MOCHA_OPTS="--reporter mocha-junit-reporter" \
DXCLI_ESLINT_OPTS="--format junit --output-file $CWD/reports/eslint.xml" \
DXCLI_TSLINT_OPTS="--format junit > $CWD/reports/tslint.xml" \
duration "${NYC[@]}" yarn test

duration "${NYC[@]}" report --reporter=text-lcov > coverage.lcov

duration curl -s https://codecov.io/bash | bash
}

_release() {
yarn --frozen-lockfile
./node_modules/.bin/dxcli-dev-semantic-release
}

case "$1" in
release) _release;;
*) _test;;
esac

0 comments on commit 77aff3b

Please sign in to comment.