diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..426766eee --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,29 @@ +name: Continuous Integration + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '14' + + - name: ๐Ÿ“ฆ Install dependencies + run: npm ci + env: + CI: true + + - name: ๐Ÿงช Run tests + run: | + npm run doctest || true # TODO: Add all doctests + npm test + env: + CI: true + + - name: ๐Ÿ’„ Code style + run: npm run style + env: + CI: true diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml deleted file mode 100644 index 39b9ee544..000000000 --- a/.github/workflows/nodejs.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Node CI -on: [push, pull_request] -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [14.x] - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node-version }} - - name: npm install, build, and test - run: | - npm install doctest standard --save-dev - npx doctest **/*.js || true # TODO: Add all doctests - npx standard - npm ci - npm run build --if-present - npm test - env: - CI: true diff --git a/package.json b/package.json index 0b8bfe122..c5a55fe84 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,9 @@ "description": "A repository for All algorithms implemented in Javascript (for educational purposes only)", "main": "", "scripts": { - "test": "jest --no-cache" + "doctest": "doctest **/*.js", + "test": "jest --no-cache", + "style": "standard" }, "author": "TheAlgorithms", "license": "GPL-3.0",