Skip to content

Commit

Permalink
Merge pull request #59 from BitGo/add_gha_ci
Browse files Browse the repository at this point in the history
ci: add a job for running tests on pull requests
  • Loading branch information
louib-bitgo authored Jan 5, 2023
2 parents 00b6107 + 216347e commit ded0679
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 19 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: CI

on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [lts/-2, lts/-1]

name: Node.js ${{ matrix.node-version }}
steps:
- name: Checkout
uses: actions/checkout@v3

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

# Install npm greater-than-or-equal-to 7 for consistent dependency resolution.
# We can remove this when Node.js 16 is the oldest LTS (2023-04-30).
- name: Update npm
run: npm install --global 'npm@>7'

- name: Cache node_modules
uses: actions/cache@v3
id: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}

- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci

- name: Compile TypeScript
run: npm run build

- name: Test
run: npm test
38 changes: 19 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ded0679

Please sign in to comment.