chore(deps): bump actions/setup-node from 2 to 4 #537
Workflow file for this run
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
name: Testing | |
on: | |
push: | |
branches: | |
- main | |
- v1.* | |
pull_request: | |
branches: | |
- '**' | |
env: | |
CI: true | |
jobs: | |
test: | |
name: Test for Stylelint ${{ matrix.stylelint }} on Node.js ${{ matrix.node-version }} and ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: [18] | |
os: [ubuntu-latest, macos-latest] | |
stylelint: [14, 15] | |
include: | |
- stylelint: 15 | |
node-version: 14 # For some reason jest-runner-vscode doesn't work well with Node v18 and Windows. | |
os: windows-latest | |
- stylelint: 14 | |
node-version: 14 # For some reason jest-runner-vscode doesn't work well with Node v18 and Windows. | |
os: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
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 cache | |
uses: actions/cache@v2 | |
id: npm-cache | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install latest npm | |
run: npm install --global [email protected] | |
# TODO: [email protected] is broken on Windows. See https://github.com/npm/cli/issues/4341 | |
# run: npm install --global npm@latest | |
- name: Install dependencies | |
run: npm ci | |
- name: Install stylelint v15 | |
run: npm i -D stylelint@^15 | |
if: matrix.stylelint == 15 | |
- name: Install stylelint v14 | |
run: npm i -D stylelint@^14 stylelint-scss@^4.3.0 | |
if: matrix.stylelint == 14 | |
- name: Cache VS Code binaries | |
uses: actions/cache@v2 | |
id: vscode-cache | |
with: | |
path: .vscode-test | |
key: ${{ runner.os }}-vscode-${{ hashFiles('test/e2e/jest-runner-vscode.config.js') }} | |
restore-keys: | | |
${{ runner.os }}-vscode- | |
- name: Download VS Code | |
run: npm run download-vscode | |
- name: Run unit tests | |
run: npm run test:unit -- --coverage | |
- name: Run integration tests | |
run: npm run test:integration -- --coverage | |
- name: Run end-to-end tests (Linux) | |
if: runner.os == 'Linux' | |
run: xvfb-run -a npm run test:e2e -- --silent | |
- name: Run end-to-end tests (non-Linux) | |
if: runner.os != 'Linux' | |
run: npm run test:e2e -- --silent |