This repository has been archived by the owner on Mar 13, 2024. It is now read-only.
Update linting dependencies (major) #162
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
env: {} | |
# FILE GENERATED WITH: npx ghat voxpelli/ghatemplates/eslint-external | |
# SOURCE: https://github.com/voxpelli/ghatemplates | |
name: Test External | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
inputs: | |
moduleSet: | |
description: 'Module set' | |
required: true | |
default: 'nonCompliant' | |
type: choice | |
options: | |
- compliant | |
- nonCompliant | |
jobs: | |
read_external_projects: | |
name: Read list of ${{ github.event.inputs.moduleSet || 'compliant' }} external projects | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- uses: actions/checkout@v3 | |
- id: set-matrix | |
run: echo "::set-output name=matrix::$(cat external.json | jq -c '.${{ github.event.inputs.moduleSet || 'compliant' }}')" | |
test_external: | |
needs: read_external_projects | |
name: Test ${{ matrix.project }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
node_version: [lts/*] | |
project: ${{ fromJson(needs.read_external_projects.outputs.matrix) }} | |
steps: | |
- name: Checkout main project | |
uses: actions/checkout@v3 | |
with: | |
path: main | |
- name: Checkout ${{ matrix.project }} | |
uses: actions/checkout@v3 | |
with: | |
repository: ${{ matrix.project }} | |
path: project | |
- name: Use Node.js ${{ matrix.node_version }} | |
uses: actions/setup-node@v3 | |
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)" | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json', '**/package.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: install main | |
run: '[ -f package-lock.json ] && npm ci --ignore-scripts || npm install --ignore-scripts' | |
working-directory: ./main | |
- name: install project | |
run: '[ -f package-lock.json ] && npm ci --ignore-scripts || npm install --ignore-scripts' | |
working-directory: ./project | |
- name: modify project eslint | |
run: sed 's/"@voxpelli"/"..\/main\/test.eslintrc"/' .eslintrc > tmp.eslintrc && rm .eslintrc && mv tmp.eslintrc .eslintrc | |
working-directory: ./project | |
- name: run eslint | |
run: ../main/node_modules/.bin/eslint --resolve-plugins-relative-to ../main --ext js . | |
working-directory: ./project |