Skip to content

Ignore code cov Angular ESLint v13 fallback logic #130

Ignore code cov Angular ESLint v13 fallback logic

Ignore code cov Angular ESLint v13 fallback logic #130

Workflow file for this run

name: CI
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm ci --no-fund
- run: npm run lint
test:
runs-on: ubuntu-latest
name: "test (Node.js ${{ matrix.node-version }}, ESLint ${{ matrix.eslint-version }}, Angular ESLint ${{ matrix.angular-eslint-version[0] }})"
strategy:
fail-fast: false # Run all jobs, even when previous fails.
matrix:
# Run on latest and Angular supported Node.js versions,
# and assume that the intermediate versions are good.
node-version:
# Angular supported Node.js versions.
# https://angular.io/guide/versions
- 14.15.0
- 16.14.0
- 18.10.0
- latest
eslint-version: [7, 8]
# Angular ESLint version, and corresponding typescript-eslint version.
angular-eslint-version:
- [13, "5.27.1"]
- [14, "latest"]
- [15, "latest"]
- [16, "latest"]
exclude:
# Angular v16 dropped support for NodeJS v14.
- node-version: 14.15.0
angular-eslint-version: [16, "latest"]
steps:
- uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
# Cannot use `npm ci`, because this package uses ESLint plugins,
# which conflict with the different installations below.
# Also the package-lock file is too new for npm on older NodeJS versions.
- name: Install packages
run: npm install rimraf typescript jest jest-junit ts-jest semver @types/semver
- name: Install Angular ESLint ${{ matrix.angular-eslint-version[0] }}
run: |
npm install --legacy-peer-deps \
@angular-eslint/template-parser@${{ matrix.angular-eslint-version[0] }} \
@angular-eslint/utils@${{ matrix.angular-eslint-version[0] }} \
@angular/compiler@${{ matrix.angular-eslint-version[0] }} \
@typescript-eslint/eslint-plugin@${{ matrix.angular-eslint-version[1] }} \
@typescript-eslint/parser@${{ matrix.angular-eslint-version[1] }}
- name: Install ESLint ${{ matrix.eslint-version }}
run: npm install eslint@${{ matrix.eslint-version }}
- name: Run tests
run: npm run test
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # Run this step even if previous step failed.
with:
name: "test report (Node.js ${{ matrix.node-version }}, ESLint ${{ matrix.eslint-version }}, Angular ESLint ${{ matrix.angular-eslint-version[0] }})"
path: coverage/junit.xml
reporter: jest-junit
copyright:
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: FantasticFiasco/action-update-license-year@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
id: license
- name: Merge PR
if: steps.license.outputs.pullRequestNumber != ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr merge --rebase --delete-branch ${{ steps.license.outputs.pullRequestNumber }}