Add scripts to help people replicate CI

This commit is contained in:
Dranaxel 2020-07-07 11:48:21 +02:00 committed by Oliver Blanthorn
parent d65fd5cff3
commit 6c0ba6ecd0
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3
4 changed files with 19 additions and 6 deletions

View file

@ -11,7 +11,7 @@ commands:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- ./node_modules
- run: yarn run build
- run: bash -c 'yarn run build'
jobs:
lint:
docker:
@ -20,21 +20,19 @@ jobs:
- run: sudo apt update
- run: sudo apt install -qq shellcheck
- commoncmd
- run: bash -c 'GLOBIGNORE="node_modules" shellcheck -e2012 **/*.sh'
- run: yarn run lint
- run: bash -c '"$(yarn bin)/eslint" src --ext .ts'
- run: bash -c './ci/lint.sh'
unit:
docker:
- image: circleci/node:latest
steps:
- commoncmd
- run: bash -c '"$(yarn bin)/jest" src'
- run: bash -c './ci/unit.sh'
mozilla:
docker:
- image: circleci/node:latest
steps:
- commoncmd
- run: bash -c 'cd build; "$(yarn bin)/web-ext" lint'
- run: bash -c 'ci/mozilla.sh'
workflows:
version: 2

9
ci/lint.sh Executable file
View file

@ -0,0 +1,9 @@
#!/bin/sh
cd ${0%/*}/..
if ! [ -x "$(command -v shellcheck)" ]; then
GLOBIGNORE="node_modules" shellcheck -e2012 **/*.sh
else
echo "Warning: shellcheck is not installed, skipping shell scripts"
fi
yarn run lint
"$(yarn bin)/eslint" --ext .ts

3
ci/mozilla.sh Executable file
View file

@ -0,0 +1,3 @@
#! /bin/sh
cd ${0%/*}/../build
"$(yarn bin)/web-ext" lint

3
ci/unit.sh Executable file
View file

@ -0,0 +1,3 @@
#! /bin/sh
cd ${0%/}
"$(yarn bin)/jest" src