Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore unit tests #177

Merged
merged 14 commits into from
Nov 28, 2024
31 changes: 19 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,28 @@ on:
branches: [ "master" ]

jobs:
build:
validate_tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Cache Dependencies
id: cache_npm
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-

- name: Install dependencies
run: |
npm install
- name: Install dependencies
if: steps.cache_npm.outputs.cache-hit != 'true'
run: npm install

- name: Run test steps
run: |
grunt
- name: Run test steps
run: |
grunt
npm run test
25 changes: 0 additions & 25 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module.exports = function( grunt ) {
grunt.loadNpmTasks( "grunt-shell" );
grunt.loadNpmTasks( "grunt-contrib-compress" );
grunt.loadNpmTasks( "grunt-contrib-csslint" );
grunt.loadNpmTasks( "grunt-blanket-mocha" );
grunt.loadNpmTasks( "grunt-eslint" );

var secrets;
Expand Down Expand Up @@ -51,20 +50,6 @@ module.exports = function( grunt ) {
}
},

blanket_mocha: {
test: {
src: [ "test/tests.html" ],
options: {
threshold: 5,
page: {
settings: {
webSecurityEnabled: false
}
}
}
}
},

compress: {
makeFW: {
options: {
Expand Down Expand Up @@ -106,22 +91,12 @@ module.exports = function( grunt ) {
"git diff-index --quiet HEAD || git commit -m 'Localization: Update languages from Transifex'",
"git push"
].join( "&&" )
},
startDemo: {
command: "test/launch_osdemo.sh start"
},
stopDemo: {
command: [
"test/launch_osdemo.sh stop",
"rm -r build/firmware/unified"
].join( "&&" )
}
}
} );

// Default task(s).
grunt.registerTask( "default", [ "eslint" ] );
grunt.registerTask( "test", [ "default", "blanket_mocha" ] );
grunt.registerTask( "updateLang", [ "shell:updateLang" ] );
grunt.registerTask( "pushEng", [ "shell:pushEng" ] );
grunt.registerTask( "prepareFW", [ "compress:makeFW", "shell:unzipFW" ] );
Expand Down
11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,23 +117,12 @@ This project uses Grunt to automate various development tasks. Here are some of

* **`grunt eslint`**: Checks JavaScript code for potential errors and style issues.
* **`grunt csslint`**: Analyzes CSS code for potential errors and style issues.
* **`grunt blanket_mocha`**: Runs tests using Mocha and Blanket.js to generate code coverage reports.

**Building and Deployment**

* **`grunt compress:makeFW`**: Creates a ZIP archive of the application files for firmware updates.
* **`grunt shell:updateUI`**: Updates the UI on the OpenSprinkler device by transferring the ZIP archive.
* **`grunt shell:updateBetaUI`**: Updates the UI on a beta OpenSprinkler device.

**Localization**

* **`grunt shell:pushEng`**: Extracts English strings for translation, pushes them to Transifex, and updates the English PO file.
* **`grunt shell:updateLang`**: Pulls translations from Transifex and updates the language files.

**Other**

* **`grunt shell:startDemo`**: Starts a demo instance of the OpenSprinkler app.
* **`grunt shell:stopDemo`**: Stops the demo instance.
* **`grunt bump`**: Bumps the version number in various files (source code, Cordova config, and package.json) and push commit
* **`grunt bump-version`**: Bumps the version number in various files (source code, Cordova config, and package.json). Does not commit or push!

Loading