Skip to content

Commit

Permalink
Port the unit test workflow to GitHub Actions (#1364)
Browse files Browse the repository at this point in the history
* Port unit test workflow to GitHub Actions

Signed-off-by: CaptainIRS <36656347+CaptainIRS@users.noreply.github.com>

* Change workflow name for good badge name

Signed-off-by: CaptainIRS <36656347+CaptainIRS@users.noreply.github.com>

* Add badge in README

Signed-off-by: CaptainIRS <36656347+CaptainIRS@users.noreply.github.com>

* Generate package lock with `npm install --package-lock-only`

Signed-off-by: CaptainIRS <36656347+CaptainIRS@users.noreply.github.com>

* Remove caching for now - will tackle this later

Signed-off-by: CaptainIRS <36656347+CaptainIRS@users.noreply.github.com>
  • Loading branch information
CaptainIRS committed Jun 14, 2022
1 parent 0c1e973 commit 5b96845
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Unit Tests

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

jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Check correct usage of Caliper package names
run: ./scripts/check-package-names.sh
- name: Install project dependencies
run: npm install
- name: Bootstrap lerna
run: npm run bootstrap
- name: Check the version consistency of subpackages
run: ./packages/caliper-publish/publish.js version check
- name: Run unit tests
run: npm test
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ architecture.pptx
output.log
lerna-debug.log

# We prefer to not use lock files
**/package-lock.json

.idea/
**/node_modules/
**/log/
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ![Hyperledger Caliper](https://wiki.hyperledger.org/download/attachments/2392434/Hyperledger_Caliper_Logo_Color.svg?version=1&modificationDate=1548883186000&api=v2)

[![Build Status](https://dev.azure.com/Hyperledger/Caliper/_apis/build/status/Caliper?branchName=main)](https://dev.azure.com/Hyperledger/Caliper/_build/latest?definitionId=33&branchName=main)
[![Unit Tests](https://github.com/hyperledger/caliper/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/hyperledger/caliper/actions/workflows/unit-tests.yml)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/2381/badge)](https://bestpractices.coreinfrastructure.org/projects/2381)
[![license](https://img.shields.io/badge/license-Apache%202.0-blue)](https://github.com/hyperledger/caliper/blob/main/LICENSE)
[![node (scoped)](https://img.shields.io/node/v/@hyperledger/caliper-cli)](https://www.npmjs.com/package/@hyperledger/caliper-cli)
Expand Down

0 comments on commit 5b96845

Please sign in to comment.