Skip to content

Commit a5afc76

Browse files
GH Actions (#375)
* Fix whitespace * (actions) add GH actions; update travis * Fix missing semi-colon * Drop unused concat task and related * Add tests * Run tests in CI * (travis) remove travis * (lint) ignore in grunt config * don't use outdated cdn in browser tests * (actions) build needs to be in sync with library * build; add package-lock.json * Remove bower.json
1 parent 2dc003c commit a5afc76

22 files changed

+12696
-417
lines changed

.github/workflows/main.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches-ignore:
7+
- develop
8+
9+
jobs:
10+
ci:
11+
name: ${{ matrix.node_version }}
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
node_version: [14, 16]
17+
steps:
18+
- uses: actions/checkout@v2
19+
- uses: actions/setup-node@v2
20+
with:
21+
node-version: ${{ matrix.node_version }}
22+
- name: Install grunt-cli
23+
run: npm install -g grunt-cli
24+
- name: Install
25+
run: npm install
26+
- name: Build
27+
run: npm run build
28+
- name: Test
29+
run: npm test
30+
- name: Build Check
31+
run: |
32+
echo -e "\e[1m\e[35mChecking build folder is up-to-date with library\e[0m"
33+
changed_build_files=$(git -C "$(git rev-parse --show-toplevel)" diff --name-only HEAD -- build)
34+
if [ -n "$changed_build_files" ]
35+
then
36+
echo -e "\e[1m\e[31mBuild folder is out-of-sync with library. Build library, npm run build, and (ammend) commit\e[0m"
37+
exit 1
38+
else
39+
echo -e "\e[1m\e[32mBuild folder is up-to-date with library\e[0m"
40+
fi

.travis.yml

-16
This file was deleted.

Gruntfile.js

+3-14
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,10 @@ module.exports = function(grunt) {
4040
build: {
4141
configFile: './test/karma.conf.js',
4242
singleRun: true,
43-
browsers: ['PhantomJS']
43+
browsers: process.env.CI ? ['FirefoxHeadless'] : ['Firefox'] // eslint-disable-line
4444
}
4545
},
4646
watch: {
47-
dev: {
48-
options: {
49-
interrupt: true
50-
},
51-
files: [
52-
'./src/*.js',
53-
'./src/**/*.js'
54-
],
55-
tasks: ['concat']
56-
},
5747
build_and_watch: {
5848
options: {
5949
interrupt: true
@@ -148,7 +138,6 @@ module.exports = function(grunt) {
148138
}
149139
});
150140

151-
grunt.loadNpmTasks('grunt-contrib-concat');
152141
grunt.loadNpmTasks('grunt-contrib-watch');
153142
grunt.loadNpmTasks('grunt-contrib-clean');
154143
grunt.loadNpmTasks('grunt-jsdoc');
@@ -158,11 +147,11 @@ module.exports = function(grunt) {
158147
grunt.loadNpmTasks('grunt-shell');
159148
grunt.loadNpmTasks('gruntify-eslint');
160149

161-
grunt.registerTask('dev', ['concat', 'watch']);
162150
grunt.registerTask('transpile', ['pipe', 'execute']);
163151
grunt.registerTask('build', ['eslint:lint', 'pipe', 'shell']);
164-
grunt.registerTask('build_and_watch', ['watch']);
152+
grunt.registerTask('build_and_watch', ['build', 'watch']);
165153
grunt.registerTask('doc', ['clean', 'jsdoc']);
166154
grunt.registerTask('lint', ['eslint:lint',]);
167155
grunt.registerTask('lint-fix', ['eslint:fix',]);
156+
grunt.registerTask('test', ['karma',]);
168157
};

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
ros3djs [![Build Status](https://api.travis-ci.org/RobotWebTools/ros3djs.png)](https://travis-ci.org/RobotWebTools/ros3djs)
2-
=======
1+
# ros3djs
2+
3+
[![CI](https://github.com/RobotWebTools/ros3djs/actions/workflows/main.yml/badge.svg)](https://github.com/RobotWebTools/ros3djs/actions/workflows/main.yml)
4+
35

46
#### 3D Visualization Library for use with the ROS JavaScript Libraries
57
For full documentation, see [the ROS wiki](http://ros.org/wiki/ros3djs) or check out some [working demos](http://robotwebtools.org/demos.html).

bower.json

-28
This file was deleted.

0 commit comments

Comments
 (0)