Skip to content

Commit d72e659

Browse files
authored
Merge pull request #3 from labjack/publish-locally-ci
Publish locally ci
2 parents 50e7d40 + b494033 commit d72e659

47 files changed

Lines changed: 1518 additions & 812 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/node.js.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Node.js CI
5+
6+
on:
7+
push:
8+
branches: [ publish-locally-ci ]
9+
pull_request:
10+
branches: [ publish-locally-ci ]
11+
12+
jobs:
13+
build:
14+
15+
strategy:
16+
matrix:
17+
node-version: [8.9.4]
18+
platform: [ubuntu-16.04, macos-latest, windows-latest]
19+
20+
runs-on: ${{ matrix.platform }}
21+
22+
steps:
23+
- name: Get current date
24+
uses: 1466587594/get-current-time@v2
25+
id: date
26+
with:
27+
format: YYYY_MM_DD
28+
utcOffset: "+08:00"
29+
- name: Download ljm
30+
if: ${{ matrix.platform == 'ubuntu-16.04' }}
31+
uses: wei/wget@v1
32+
with:
33+
args: -O labjack_ljm_software.tar.gz https://labjack.com/sites/default/files/software/labjack_ljm_software_2019_07_16_x86_64.tar.gz
34+
- name: Install ljm
35+
if: ${{ matrix.platform == 'ubuntu-16.04' }}
36+
run: tar xfz labjack_ljm_software.tar.gz && cd ./labjack_ljm_software_2019_07_16_x86_64 && sudo ./labjack_ljm_installer.run
37+
- uses: actions/checkout@v2
38+
- name: Use Node.js ${{ matrix.node-version }}
39+
uses: actions/setup-node@v1
40+
with:
41+
node-version: ${{ matrix.node-version }}
42+
# - run: npm ci # doesn't work with node8
43+
- run: npm install --global node-gyp@latest
44+
- run: npm install --global --production windows-build-tools --vs2015
45+
if: ${{ matrix.platform == 'windows-latest' }}
46+
- run: npm install
47+
- run: npm config set msvs_version 2015
48+
- run: npm run setup
49+
- name: Fix lerna mess
50+
run: node ./scripts/fix_lerna_backup.js
51+
- run: npm run build
52+
- run: SKIP_HARDWARE_TEST=true npm run test
53+
if: ${{ matrix.platform == 'ubuntu-16.04' }}
54+
55+
- run: ls ./ljswitchboard-builder
56+
57+
- uses: actions/upload-artifact@v2
58+
with:
59+
name: kipling.3.1.18.${{ steps.date.outputs.date }}_linux64.tar.gz
60+
path: ljswitchboard-builder/kipling.3.1.18.${{ steps.date.outputs.formattedTime }}_linux64.tar.gz
61+
if: ${{ matrix.platform == 'ubuntu-16.04' }}
62+
- uses: actions/upload-artifact@v2
63+
with:
64+
name: kipling.3.1.18.${{ steps.date.outputs.date }}_windows.zip
65+
path: ljswitchboard-builder/kipling.3.1.18.${{ steps.date.outputs.formattedTime }}_win64.zip
66+
if: ${{ matrix.platform == 'windows-latest' }}
67+
- uses: actions/upload-artifact@v2
68+
with:
69+
name: kipling.3.1.18.${{ steps.date.outputs.date }}_macos.zip
70+
path: ljswitchboard-builder/kipling.3.1.18.${{ steps.date.outputs.formattedTime }}_mac64.zip
71+
if: ${{ matrix.platform == 'macos-latest' }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,3 +177,6 @@ bh_unicode_properties.cache
177177
GitHub.sublime-settings
178178

179179
# End of https://www.gitignore.io/api/sublimetext
180+
181+
### IntelliJ
182+
.idea

LabJack-nodejs/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
"allocate_buffer": "^1.0.0",
3232
"async": "1.5.2",
3333
"diff": "^4.0.1",
34-
"ffi-napi": "^2.4.7",
3534
"ljm-ffi": "*",
3635
"ljswitchboard-ljm_driver_constants": "*",
3736
"ljswitchboard-modbus_map": "*",

LabJack-process_manager/test/advanced_test.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,18 @@ var exeName = {
3232
'win32': 'node.exe',
3333
'darwin': 'node'
3434
}[platform];
35+
3536
var arch = process.arch;
3637
var rootDir = process.cwd();
3738

3839
var pathOfVersionFolders = path.join(rootDir, binariesDir, platform, arch);
40+
41+
if (!fs.existsSync(pathOfVersionFolders)) {
42+
exports.tests = {
43+
};
44+
return;
45+
}
46+
3947
var nodejsVersions = fs.readdirSync(pathOfVersionFolders);
4048
var nodeExecutables = {};
4149
nodejsVersions.forEach(function(version) {
@@ -104,7 +112,7 @@ exports.tests = {
104112
var arch = process.arch;
105113
var rootDir = process.cwd();
106114

107-
115+
108116
nodejsVersions.forEach(function(version) {
109117
var fullPath = path.join(rootDir, binariesDir, platform, arch, version, exeName);
110118
binaryPaths.push({'path':fullPath,'exists': false});

LabJack-process_manager/test/basic_test.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// Require npm modules
66
var q = require('q');
7+
var fs = require('fs');
78

89
function createBasicTest(imports) {
910
var process_manager;
@@ -18,6 +19,12 @@ function createBasicTest(imports) {
1819
node_binary = imports.node_binary;
1920
constants = process_manager.constants;
2021

22+
if (!fs.existsSync(imports.node_binary)) { // skip for linux
23+
this.tests = {
24+
};
25+
return;
26+
}
27+
2128
// master_process object
2229
var mp;
2330
var mpEventEmitter;
@@ -126,7 +133,7 @@ function createBasicTest(imports) {
126133
'getProcessInfo',
127134
'getEventEmitter'
128135
];
129-
136+
130137
createMasterProcess()
131138
.then(function(retData) {
132139
// Verify function list
@@ -142,8 +149,8 @@ function createBasicTest(imports) {
142149
});
143150
},
144151
/**
145-
* Initialize the master_process instance, this test makes sure that
146-
* initializing the master process returns an event listener. this process
152+
* Initialize the master_process instance, this test makes sure that
153+
* initializing the master process returns an event listener. this process
147154
* can be done synchronously but is wrapped by a promise to make it async.
148155
*/
149156
'initialize_master_process': function(test) {
@@ -201,8 +208,8 @@ function createBasicTest(imports) {
201208
},
202209
/**
203210
* This test starts a new process and performs some IO to the process and
204-
* checks the results of the sendReceive message as well as the send &
205-
* sendMessage functions. The one way messages get handled by the
211+
* checks the results of the sendReceive message as well as the send &
212+
* sendMessage functions. The one way messages get handled by the
206213
* previously established event listeners.
207214
*/
208215
'basic_execution': function(test) {
@@ -250,7 +257,7 @@ function createBasicTest(imports) {
250257
// Check to make sure that the testEvents were fired
251258
test.deepEqual(receivedTestEvents, expectedTestEvents, 'Issue with event messaging');
252259

253-
// Check to make sure that the the sendReceive/master_process
260+
// Check to make sure that the the sendReceive/master_process
254261
// functions were called properly
255262
// console.log('retData', returnedData[5].retData);
256263
// var buff = new Buffer(1);

0 commit comments

Comments
 (0)