Skip to content

ci: eslint v9 test #136

ci: eslint v9 test

ci: eslint v9 test #136

Workflow file for this run

# Github actions workflow name
name: CI
env: {NODE_VERSION: 20}
# Triggers the workflow on push or pull request events
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
windows_test:
name: Test eslint-plugin-wxml on windows with node20
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with: {node-version: '${{ env.NODE_VERSION }}'}
- run: npm install
- run: npm run lint
- run: npm run test
macos_test:
name: Test eslint-plugin-wxml on macos with node20
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with: {node-version: '${{ env.NODE_VERSION }}'}
- run: npm install
- run: npm run lint
- run: npm run test
eslint9_test:
name: Test eslint-plugin-wxml with eslint9
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with: {node-version: '${{ env.NODE_VERSION }}'}
- run: npm install
- run: npm install eslint@9
- run: npm run lint
- run: npm run test
eslint8_test:
name: Test eslint-plugin-wxml with eslint8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with: {node-version: '${{ env.NODE_VERSION }}'}
- run: npm install
- run: npm install eslint@8
- run: npm run lint
- run: npm run test
node_tests:
name: 'Test eslint-plugin-wxml on ${{matrix.os}} with node${{matrix.node}}'
strategy:
matrix:
os: [ubuntu-latest]
node: [12, 14, 16, 18, 21]
runs-on: ${{ matrix.os }}
steps:
# Pull repo to test machine
- uses: actions/checkout@v3
# Configures the node version used on GitHub-hosted runners
- uses: actions/setup-node@v3
with:
# The Node.js version to configure
node-version: ${{ matrix.node }}
# Caching dependencies to speed up workflows
- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v3
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install npm dependencies
run: npm install
- name: Print put node & npm version
# Output useful info for debugging.
run: node --version && npm --version
- name: ESlint Lint
run: npm run lint
- name: Run Test
run: npm run test