2021-11-30 15:47:11 +00:00
|
|
|
name: Grunt tests
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
2022-12-01 12:53:34 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2021-11-30 15:47:11 +00:00
|
|
|
jobs:
|
|
|
|
grunt:
|
|
|
|
name: Grunt based tests with Node.js ${{ matrix.node-version }}
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-03-29 22:21:25 +00:00
|
|
|
# Node.js 10 is required by jQuery infra
|
|
|
|
node-version: [10.x, 16.x, 18.x]
|
2021-11-30 15:47:11 +00:00
|
|
|
|
|
|
|
steps:
|
2022-07-11 10:22:26 +00:00
|
|
|
- uses: actions/checkout@v3
|
2021-11-30 15:47:11 +00:00
|
|
|
|
2022-07-11 10:17:01 +00:00
|
|
|
- uses: actions/setup-node@v3
|
2021-11-30 15:47:11 +00:00
|
|
|
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
|
2022-07-11 10:17:24 +00:00
|
|
|
uses: actions/cache@v3
|
2021-11-30 15:47:11 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
# Keep these steps in sync with the default command tasks in our Gruntfile!
|
|
|
|
- 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
|
|
|
|
|
2021-12-03 18:27:15 +00:00
|
|
|
valid:
|
|
|
|
name: Build & tests
|
2021-11-30 15:47:11 +00:00
|
|
|
|
2021-12-03 18:27:15 +00:00
|
|
|
needs: grunt
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Grunt based tests passed
|
|
|
|
run: echo "✅"
|