Skip to content

Commit

Permalink
actions
Browse files Browse the repository at this point in the history
  • Loading branch information
TrentHouliston committed Jan 9, 2024
1 parent fc2955e commit acc40c1
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 56 deletions.
38 changes: 22 additions & 16 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ name: Node.js CI

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
build:

runs-on: ${{ matrix.os }}

strategy:
Expand All @@ -21,16 +20,23 @@ jobs:
node-version: [12.x, 14.x, 16.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
# Run the tests up to 5 times if it fails (to avoid the error "Network error when sending
# the announce packet: Bad file descriptor" that occurs sometimes on startup)
# TODO: investigate and fix the actual issue.
- shell: bash
run: ./tests/run-with-retries.sh
- name: Checkout Code
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"

- name: Install node-gyp
run: npm install -g node-gyp

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build --if-present

- name: Run tests
run: npm test
26 changes: 15 additions & 11 deletions .github/workflows/publish-to-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,24 @@ jobs:
publish_to_npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout Code
uses: actions/checkout@v3
with:
ref: main

# Installs Node and sets up up the .npmrc file to publish to npm
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
# Run the tests up to 5 times if it fails (to avoid the error "Network error when sending
# the announce packet: Bad file descriptor" that occurs sometimes on startup)
# TODO: investigate and fix the actual issue.
- shell: bash
run: ./tests/run-with-retries.sh
- run: node .github/auto-publish-action.js
node-version: "16.x"
registry-url: "https://registry.npmjs.org"

- name: "Install Dependencies"
run: npm ci

- name: "Test Code"
run: npm test

- name: "Publish to npm"
run: node .github/auto-publish-action.js
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
84 changes: 84 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"files.associations": {
"__bit_reference": "cpp",
"deque": "cpp",
"typeindex": "cpp",
"typeinfo": "cpp",
"stdexcept": "cpp",
"__bits": "cpp",
"__config": "cpp",
"__debug": "cpp",
"__errc": "cpp",
"__hash_table": "cpp",
"__locale": "cpp",
"__mutex_base": "cpp",
"__node_handle": "cpp",
"__split_buffer": "cpp",
"__threading_support": "cpp",
"__tree": "cpp",
"__tuple": "cpp",
"__verbose_abort": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"complex": "cpp",
"condition_variable": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"exception": "cpp",
"fstream": "cpp",
"future": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"ios": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"list": "cpp",
"locale": "cpp",
"map": "cpp",
"memory": "cpp",
"mutex": "cpp",
"new": "cpp",
"optional": "cpp",
"ostream": "cpp",
"queue": "cpp",
"ratio": "cpp",
"regex": "cpp",
"set": "cpp",
"sstream": "cpp",
"stack": "cpp",
"streambuf": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"thread": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"unordered_map": "cpp",
"variant": "cpp",
"vector": "cpp",
"__nullptr": "cpp",
"__string": "cpp",
"chrono": "cpp",
"compare": "cpp",
"concepts": "cpp",
"numeric": "cpp",
"random": "cpp",
"algorithm": "cpp",
"filesystem": "cpp"
}
}
29 changes: 0 additions & 29 deletions tests/run-with-retries.sh

This file was deleted.

0 comments on commit acc40c1

Please sign in to comment.