-
Notifications
You must be signed in to change notification settings - Fork 13
/
action.yml
85 lines (83 loc) · 2.89 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: 'verible-linter'
description: 'This action lints Verilog/SystemVerilog code'
author: 'Antmicro'
inputs:
config_file:
description: 'Relative path to configuration file'
required: false
extra_args:
description: 'Extra arguments for verible-linter'
required: false
paths:
description: 'Optional array of paths to directories with source code to check'
required: false
default: '.'
exclude_paths:
description: 'Exclude these paths after finding all target files'
required: false
extensions:
description: 'Run linting on files ending with following extensions'
required: false
default: ''
log_file:
description: 'Name for a log file'
required: false
default: 'verible-verilog-lint.log'
github_token:
description: 'GITHUB_TOKEN'
default: ''
reviewdog_reporter:
description: '-reporter option to reviewdog'
default: 'github-pr-review'
suggest_fixes:
description: 'Post results of using --autofix option as change suggestions,
works only with github-pre-review reporter'
default: 'true'
fail_on_error:
description: 'Fail the action when rule violations are found'
default: 'false'
verible_version:
description: 'Use selected Verible version (defaults to latest release)'
default: 'latest'
runs:
using: 'composite'
steps:
- name: Check if running on Ubuntu Linux
shell: bash
run: |
source /etc/os-release
case "$ID" in
ubuntu) echo 'Running on Ubuntu Linux'; exit 0 ;;
*) echo 'Not running on Ubuntu Linux'; exit 1 ;;
esac
- name: Install dependencies
shell: bash
run: |
sudo apt-get update -qq
sudo apt-get -y install --no-install-recommends git python3 python3-click python3-unidiff
- name: Install Verible
uses: chipsalliance/verible-actions-common/install-verible@main
with:
github_token: ${{ inputs.github_token }}
verible_version: ${{ inputs.verible_version }}
- name: Install reviewdog
uses: chipsalliance/verible-actions-common/build-reviewdog@main
- name: Run Verible linter with reviewdog
shell: bash
env:
INPUT_CONFIG_FILE: ${{ inputs.config_file }}
INPUT_EXCLUDE_PATHS: ${{ inputs.exclude_paths }}
INPUT_EXTRA_ARGS: ${{ inputs.extra_args }}
INPUT_EXTENSIONS: ${{ inputs.extensions }}
INPUT_FAIL_ON_ERROR: ${{ inputs.fail_on_error }}
INPUT_GITHUB_TOKEN: ${{ inputs.github_token }}
INPUT_LOG_FILE: ${{ inputs.log_file }}
INPUT_PATHS: ${{ inputs.paths }}
INPUT_REVIEWDOG_REPORTER: ${{ inputs.reviewdog_reporter }}
INPUT_SUGGEST_FIXES: ${{ inputs.suggest_fixes }}
run: ${{ github.action_path }}/entrypoint.sh
- name: Upload linter log
uses: actions/upload-artifact@v4
with:
name: verible-linter
path: ${{ inputs.log_file }}