Skip to content

Commit 9c1c0d4

Browse files
committed
add tests and CI workflow
1 parent bc88000 commit 9c1c0d4

File tree

5 files changed

+55
-2
lines changed

5 files changed

+55
-2
lines changed

.github/workflows/test.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: 'test'
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
publish:
12+
runs-on: ubuntu-22.04
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: setup node
18+
uses: actions/setup-node@v1
19+
with:
20+
node-version: 20
21+
22+
- name: "Test Moss 0.13 lists"
23+
run: |
24+
cd ./0.13
25+
npm install
26+
npm run test
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "Lightningrod Labs",
3+
"description": "Nurturing The Holochain Ecosystem",
4+
"id": "lightningrodlabs",
5+
"icon": "https://lightningrodlabs.org/lrl_logo.png",
6+
"contact": {
7+
"website": "https://lightningrodlabs.org"
8+
},
9+
"apps": []
10+
}

0.13/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
"version": "0.1.0",
44
"type": "module",
55
"scripts": {
6-
"test": "node --loader ts-node/esm --abort-on-uncaught-exception ./curation.ts",
7-
"write-curation-list": "node --loader ts-node/esm --abort-on-uncaught-exception ./write-curation-list.js"
6+
"test": "node --loader ts-node/esm ./validate-lists.js",
7+
"write-curation-list": "node --loader ts-node/esm --abort-on-uncaught-exception ./write-curation-list.js",
8+
"write-collective-list": "node --loader ts-node/esm --abort-on-uncaught-exception ./write-collective-list.js",
9+
"write-lists": "npm run write-curation-list && npm run write-collective-list"
810
},
911
"author": "",
1012
"license": "ISC",

0.13/validate-lists.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import fs from 'fs';
2+
import curationListObject from './modify/curation.ts';
3+
import devCollectiveListObject from './modify/developerCollective.ts';
4+
const curationListJSON = JSON.stringify(curationListObject, undefined, 4);
5+
const devCollectiveListJSON = JSON.stringify(devCollectiveListObject, undefined, 4);
6+
7+
const curationListActual = fs.readFileSync('./lists/curation.json', 'utf-8');
8+
const devCollectiveListActual = fs.readFileSync('./lists/developerCollective.json', 'utf-8');
9+
10+
if (curationListJSON !== curationListActual) throw new Error("Invalid curation list. List does not match the list defined in ./lists/curation.ts")
11+
if (devCollectiveListJSON !== devCollectiveListActual) throw new Error("Invalid developer collective Tools list. List does not match the list defined in ./lists/developerColelctive.ts")

0.13/write-collective-list.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import fs from 'fs';
2+
import developerCollectiveListObject from './modify/developerCollective.ts';
3+
const developerCollectiveListJSON = JSON.stringify(developerCollectiveListObject, undefined, 4);
4+
fs.writeFileSync('./lists/developerCollective.json', developerCollectiveListJSON);

0 commit comments

Comments
 (0)