Skip to content

Commit

Permalink
CI
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmatiy committed Oct 21, 2024
1 parent ee966c5 commit 4c3864b
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 15 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Build

on:
push:
pull_request:

env:
PRIMARY_NODEJS_VERSION: 20
REPORTER: "min"

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup node ${{ env.PRIMARY_NODEJS_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.PRIMARY_NODEJS_VERSION }}
cache: "npm"
- run: npm ci
- run: npm run lint

coverage:
name: Collect coverage
runs-on: ubuntu-latest
strategy:
matrix:
node_version:
- 20
steps:
- uses: actions/checkout@v4
- name: Setup node ${{ matrix.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
cache: 'npm'
- run: npm i # old versions of npm doesn't support lockfile v3
if: ${{ matrix.node_version < '15' }}
- run: npm ci
- run: npm run coverage
- name: Coveralls Parallel
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: node-${{ matrix.node_version }}
parallel: true

send-to-coveralls:
name: Send coverage to Coveralls
needs: coverage
runs-on: ubuntu-latest
steps:
- name: Send coverage to Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true

unit-tests:
name: Unit tests
runs-on: ubuntu-latest
strategy:
matrix:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
node_version:
- 18.0
- 18
- 20
- 22

steps:
- uses: actions/checkout@v4
- name: Setup node ${{ matrix.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
cache: "npm"
- run: npm i # old versions of npm doesn't support lockfile v3
if: ${{ matrix.node_version < '15' }}
- run: npm ci
- run: npm run transpile
- run: npm run test
- run: npm run test:cjs
3 changes: 0 additions & 3 deletions .nycrc

This file was deleted.

8 changes: 0 additions & 8 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,7 +1,7 @@
# jora-cli

[![NPM version](https://img.shields.io/npm/v/jora-cli.svg)](https://www.npmjs.com/package/jora-cli)
[![Build Status](https://travis-ci.org/discoveryjs/jora-cli.svg?branch=master)](https://travis-ci.org/discoveryjs/jora-cli)
[![Build Status](https://github.com/discoveryjs/jora-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/discoveryjs/jora-cli/actions/workflows/ci.yml)
[![Coverage Status](https://coveralls.io/repos/github/discoveryjs/jora-cli/badge.svg?branch=master)](https://coveralls.io/github/discoveryjs/jora-cli?)

Command line interface for [Jora](https://github.com/discoveryjs/jora) (a JSON query language)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"main": "./index",
"scripts": {
"test": "mocha --reporter progress",
"lint": "eslint *.js test",
"lint": "eslint *.js utils test",
"lint-and-test": "npm run lint && npm test",
"coverage": "c8 npm test",
"travis": "c8 npm run lint-and-test && npm run coveralls",
Expand Down
4 changes: 2 additions & 2 deletions test/color-fixture.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"false": false,
"true": true,
"complexJSON": {
"f\"oo\u01234"
:-0.1234, "bar": 0e-3,
"f\"oo\u01234": -0.1234,
"bar": 0e-3,
"ba/": -0.1234e12,
"quux": -1.123
}
Expand Down

0 comments on commit 4c3864b

Please sign in to comment.