mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 00:01:37 +08:00
Proposal: Clean up CI job a bit
relates to #586 and #720 Added npm scripts for doctest and style checking via standard. This allows us to call those directly via npm and not via npx. The CI job itself is now split into distinct steps (makes it more visible which step failed).
This commit is contained in:
29
.github/workflows/ci.yml
vendored
Normal file
29
.github/workflows/ci.yml
vendored
Normal file
@ -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
|
24
.github/workflows/nodejs.yml
vendored
24
.github/workflows/nodejs.yml
vendored
@ -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
|
@ -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",
|
||||
|
Reference in New Issue
Block a user