2022-11-08 04:09:15 +00:00
|
|
|
name: JS Unit Test
|
2022-11-07 23:31:13 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
# Single deploy job since we're just deploying
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Install apt updates
|
2022-11-07 23:38:53 +00:00
|
|
|
run: sudo apt -y update; sudo apt -y upgrade;
|
2022-11-07 23:31:13 +00:00
|
|
|
- name: Install prerequisites
|
2022-11-11 02:55:25 +00:00
|
|
|
uses: actions/setup-node@v3
|
2022-11-11 02:41:23 +00:00
|
|
|
with:
|
|
|
|
node-version: 18
|
2022-11-07 23:31:13 +00:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install dependencies
|
2022-11-07 23:38:53 +00:00
|
|
|
run: sudo npm install
|
2022-11-17 00:18:35 +00:00
|
|
|
- name: Start local http server
|
|
|
|
run: sudo npm run http-server
|
2022-11-07 23:31:13 +00:00
|
|
|
- name: Run tests
|
2022-11-07 23:38:53 +00:00
|
|
|
run: sudo npm test
|