Skip to content

Merge pull request #1562 from phac-nml/dependabot/gradle/com.google.g… #596

Merge pull request #1562 from phac-nml/dependabot/gradle/com.google.g…

Merge pull request #1562 from phac-nml/dependabot/gradle/com.google.g… #596

Workflow file for this run

name: Linting
on:
pull_request: # Run on all pull requests
push:
branches: # Run on any push to development or main
- development
- main
jobs:
eslint: # Lint changed JS/TS files
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3 #Checkout the project from git
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(./gradlew pnpmCacheDir -q)"
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Set up JDK 17 # Installs java 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Install dependencies
run: ./gradlew pnpmInstall
- name: Run eslint on changed files
uses: tj-actions/eslint-changed-files@v18
with:
config_path: "src/main/webapp/eslint.config.mjs"
extra_args: "--max-warnings=0"
file_extensions: |
src/main/webapp/resources/js/**/*.ts
src/main/webapp/resources/js/**/*.tsx
src/main/webapp/resources/js/**/*.js
src/main/webapp/resources/js/**/*.jsx
checkstyle: # Lint changed Java files
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3 #Checkout the project from git
- name: Set up JDK 17 # Installs java 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Run checkstyle
uses: dbelyaev/[email protected]
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
fail_on_error: true
level: error
checkstyle_config: './checkstyle.xml'