Skip to content

WIP: update integration tests #3

WIP: update integration tests

WIP: update integration tests #3

Workflow file for this run

# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
name: E2E integration
on:
push:
branches: [main, dev/martinkamar/eslint-v9]
pull_request_target:
branches: [main]
env:
GITHUB_REPO: nodejs/node
GITHUB_REPO_ESLINT_GLOB: lib
GITHUB_REPO_TSCONFIG: tsconfig.json
TEST_TARGET_DIR: test-target
TEST_RUN_DIR: test-run
jobs:
build:
name: E2E run with SARIF
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- name: Setup Node.js environment
uses: actions/setup-node@v4
- uses: actions/checkout@v4
with:
repository: ${{env.GITHUB_REPO}}
path: ${{env.TEST_TARGET_DIR}}
clean: true
- uses: actions/checkout@v4
with:
path: eslint-plugin-sdl
clean: true
- name: Create test run directory
run: mkdir ${{env.TEST_RUN_DIR}}
working-directory: ${{github.workspace}}
continue-on-error: true
- name: Install ESLint and eslint-plugin-sdl dependencies
run: |
npm i eslint
npm i eslint-plugin-security
npm i eslint-plugin-react
npm i eslint-plugin-node
npm i typescript
npm i @microsoft/eslint-formatter-sarif
working-directory: ${{env.TEST_RUN_DIR}}
- name: Link eslint-plugin-sdl
run: sudo npm link ../eslint-plugin-sdl
working-directory: ${{env.TEST_RUN_DIR}}
if: runner.os == 'Linux'
- name: Link eslint-plugin-sdl
run: npm link ../eslint-plugin-sdl
working-directory: ${{env.TEST_RUN_DIR}}
if: runner.os == 'Windows'
- name: Copy ESLint config file
run: cp ../eslint-plugin-sdl/tests/fixtures/eslint.config.js .
working-directory: ${{env.TEST_RUN_DIR}}
- name: Run ESLint
run: npx eslint
--config eslint.config.js
../${{env.TEST_TARGET_DIR}}/${{env.GITHUB_REPO_ESLINT_GLOB}}
--parser-options=project:../${{env.TEST_TARGET_DIR}}/${{env.GITHUB_REPO_TSCONFIG}}
--no-config-lookup
--format @microsoft/eslint-formatter-sarif
--output-file ./eslint-result-${{ matrix.os }}-${{github.run_id}}.sarif
working-directory: ${{env.TEST_RUN_DIR}}
continue-on-error: true
- name: Upload ESLint results as artifact
uses: actions/upload-artifact@v4
with:
name: eslint-result-${{ matrix.os }}
path: ${{env.TEST_RUN_DIR}}/eslint-result-${{ matrix.os }}-${{github.run_id}}.sarif
if-no-files-found: error