# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
  push:
    branches: [ devel ]
  pull_request:

jobs:
  build:

    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [12.x, 14.x]

    steps:
    - uses: actions/checkout@v2
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}

    - name: Install dependencies
      run: npm ci

    - name: Run tests (with node-sass support)
      run: |
        npm install node-sass@4.14.1
        npm test

    - name: Run bin/analyze-css.js for CSS file
      run: ./bin/analyze-css.js --file examples/ti.mobile.css  -p | grep metrics -B2

    - name: Run bin/analyze-css.js for SCSS file
      run: ./bin/analyze-css.js --file examples/base.scss  -p | grep offenders -A3

    - name: Run bin/analyze-css.js for external file over HTTP
      run: ./bin/analyze-css.js --url http://s3.macbre.net/analyze-css/propertyResets.css -p | grep metrics -A5

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
  push:
    branches: [ devel ]
  pull_request:

jobs:
  test:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [12.x, 14.x, 15.x]

    steps:
    - uses: actions/checkout@v2
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}

    - name: Install dependencies
      run: npm ci

    - name: Run tests (with node-sass support)
      run: |
        npm install node-sass@4.14.1
        npm test

    - name: Run bin/analyze-css.js for CSS file
      run: ./bin/analyze-css.js --file examples/ti.mobile.css  -p | grep metrics -B2

    - name: Run bin/analyze-css.js for SCSS file
      run: ./bin/analyze-css.js --file examples/base.scss  -p | grep offenders -A3

    - name: Run bin/analyze-css.js for external file over HTTP
      run: ./bin/analyze-css.js --url http://s3.macbre.net/analyze-css/propertyResets.css -p | grep metrics -A5

Test using Node.js 15.x too
Test using Node.js 15.x too