forked from jquery/jquery-ui
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build: add GitHub Actions workflow file for Grunt tests
Replaces Travis functionality.
- Loading branch information
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Grunt tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' | ||
pull_request: | ||
types: | ||
- opened | ||
- edited | ||
- reopened | ||
- synchronize | ||
|
||
jobs: | ||
grunt: | ||
name: Grunt based tests with Node.js ${{ matrix.node-version }} | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [12.x, 14.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Get npm cache directory | ||
id: npm-cache-dir | ||
run: | | ||
echo "::set-output name=dir::$(npm config get cache)" | ||
- name: Cache npm dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.npm-cache-dir.outputs.dir }} | ||
key: ${{ runner.os }}-node-${{ matrix.node-version }}-npm-${{ hashFiles('**/package.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node-${{ matrix.node-version }}-npm- | ||
${{ runner.os }}-node-${{ matrix.node-version }}- | ||
${{ runner.os }}-node- | ||
${{ runner.os }}- | ||
- name: Install npm dependencies | ||
run: npm install | ||
|
||
- name: Run lint | ||
run: node_modules/.bin/grunt lint | ||
|
||
- name: Run RequireJS | ||
run: node_modules/.bin/grunt requirejs | ||
|
||
- name: Run Qunit | ||
run: node_modules/.bin/grunt test | ||
|
||
|