Implement Format Checks for Groovy Code in GitHub Actions Workflow #7
Workflow file for this run
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
# SPDX-FileCopyrightText: 2022-2024 TII (SSRC) and the Ghaf contributors | |
# SPDX-License-Identifier: Apache-2.0 | |
name: Format-checks | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
groovy-lint: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Node.js environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Install npm-groovy-lint | |
run: npm install -g npm-groovy-lint | |
- name: Lint Groovy code (fix and check for errors) | |
run: npm-groovy-lint --fix . | |
- name: Check for errors only (fail on errors) | |
run: npm-groovy-lint --failon error . |