diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index c0cf5e0..f2d3cfc 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -6,22 +6,38 @@ name: Node.js CI on: ["push", "pull_request"] jobs: - build: + test: - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 strategy: matrix: - node-version: [16.x] + node-version: [12.x, 13.x, 14.x, 15.x, 16.x] steps: - uses: actions/checkout@v2 -# - run: sudo apt install gfortran -# - run: cd reference && make && cd .. + - run: sudo apt install gfortran + - run: cd reference && make && cd .. - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - run: npm ci - - run: npm run build --if-present + - run: npm run build - run: npm test + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + flag-name: run-${{ matrix.test_number }} + parallel: true + + finish: + needs: test + runs-on: ubuntu-18.04 + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.github_token }} + parallel-finished: true diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index b2cb83b..7b7d37e 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -9,7 +9,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 @@ -23,7 +23,7 @@ jobs: publish-npm: needs: build - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index a8bf998..f659544 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -7,7 +7,7 @@ on: jobs: publish: - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - name: Checkout diff --git a/.gitignore b/.gitignore index ee20b49..e66cc63 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /public /.cache /.parcel-cache +/coverage diff --git a/README.md b/README.md index 30be9ab..1d48ee5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # egm96-universal -[![Node.js CI](https://github.com/nicolas-van/egm96-universal/workflows/Node.js%20CI/badge.svg)](https://github.com/nicolas-van/egm96-universal/actions?query=workflow%3A%22Node.js+CI%22) [![npm](https://img.shields.io/npm/v/egm96-universal)](https://www.npmjs.com/package/egm96-universal) +[![Node.js CI](https://github.com/nicolas-van/egm96-universal/workflows/Node.js%20CI/badge.svg)](https://github.com/nicolas-van/egm96-universal/actions?query=workflow%3A%22Node.js+CI%22) [![npm](https://img.shields.io/npm/v/egm96-universal)](https://www.npmjs.com/package/egm96-universal) [![Coverage Status](https://coveralls.io/repos/github/nicolas-van/egm96-universal/badge.svg?branch=master)](https://coveralls.io/github/nicolas-van/egm96-universal?branch=master) A library to convert between EGM96-relative altitudes and WGS84 ellipsoid-relative altitudes. diff --git a/package.json b/package.json index 983008d..292237e 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "convert-data": "node ./convertDataFile.js", "test": "npm run prebuild && npm run lint && npm run jest", "lint": "npm run prebuild && eslint \"*.js\" \"src/**/*.js\"", - "jest": "npm run prebuild && jest", + "jest": "npm run prebuild && jest --config=./jest.config.js --coverage", "build": "npm run rollup", "rollup": "rollup -c", "website-build": "npm run prebuild && parcel build demo/index.html --dist-dir public --public-url ./", diff --git a/src/egm96.reference.test.js b/src/egm96.reference.test.js index 8cd5204..83330c3 100644 --- a/src/egm96.reference.test.js +++ b/src/egm96.reference.test.js @@ -1,4 +1,3 @@ -/* eslint-disable */ import * as egm96 from './egm96' import * as cp from 'child_process' @@ -94,7 +93,6 @@ test('empty test', () => { expect(true).toBe(true) }) -/* test('intersection test', () => { const coords = [] for (let a = -85; a <= 85; a += 20) { @@ -114,7 +112,6 @@ test('non intersection test', () => { testComparison(lat, lon, false) } }) -*/ // 100 randomly generated coordinates const samples = [