Skip to content

Commit

Permalink
Use Node 16/18 and Setup GitHub Actions (#26)
Browse files Browse the repository at this point in the history
* Use Node 18 and Setup GitHub Actions

* Use npm ci in github actions

* Back to npm install

Using npm ci chokes w/ node 14 -- so use npm install.

Also update checkout and setup-node actions to use v3.
  • Loading branch information
cmoesel authored Apr 24, 2023
1 parent 8832486 commit baf7875
Show file tree
Hide file tree
Showing 5 changed files with 1,062 additions and 434 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI Checks

on: [push, pull_request]

jobs:
lint:
name: Check audit, lint, and prettier
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- run: npm install
- run: npm audit
- run: npm run lint
- run: npm run prettier
env:
CI: true

test:
name: Test node ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node: [ '14', '16', '18' ]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: npm install
- run: npm test
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nodejs 14.21.1
nodejs 18.16.0
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,21 @@ codeService.ensureValueSetsInLibraryWithApiKey(library, true, 'myUmlsApiKey')
});
```

# Testing the Code

To run the automated unit tests, execute the following command:
```
$ npm test
```

# Linting the Code

To encourage quality and consistency within the code base, all code should pass eslint without any warnings. Many text editors can be configured to automatically flag eslint violations. We also provide an npm script for running eslint on the project. To check your code against eslint's rules, execute the following command:
```
$ npm run lint
```

To fix any code that violates eslint's rules:
To automatically fix code that violates eslint's rules:
```
$ npm run lint:fix
```
Expand All @@ -130,7 +137,14 @@ To encourage quality and consistency within the code base, all code should also
$ npm run prettier
```

To fix any code that violates Prettier's rules:
To automatically fix any code that violates Prettier's rules:
```
$ npm run prettier:fix
```

# Altogether Now!

To run the unit tests, linter, and prettier all in one shot, execute the following command:
```
$ npm run test:plus
```
Loading

0 comments on commit baf7875

Please sign in to comment.