-
Notifications
You must be signed in to change notification settings - Fork 1
130 lines (109 loc) · 2.98 KB
/
lint.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Lint
on:
# Runs on all PRs
pull_request:
# Manual Dispatch
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
lint_python:
name: Lint Python Code
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Install Requirements
run: |
python3 -m venv .venv
. .venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install .[dev]
- name: Lint with Flake8
run: |
. .venv/bin/activate
flake8 --statistics .
lint_tcl:
name: Lint TCL Code
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Install Requirements
run: |
python3 -m venv .venv
. .venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install .[dev]
- name: Lint with tclint
run: |
. .venv/bin/activate
tclfmt --check .
tclint --no-check-style .
spelling:
name: Check spelling
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Check spelling
run: |
python3 -m venv .venv
. .venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install .[dev]
rm -rf build
codespell
sc_version:
name: Get SiliconCompiler version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.sc_version.outputs.version }}
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Install gallery
run: |
python3 -m venv .venv
. .venv/bin/activate
pip3 install --upgrade pip
pip3 install .
- name: Get version
id: sc_version
run: |
. .venv/bin/activate
echo "version=v$(sc -version)" >> $GITHUB_OUTPUT
docker_image:
needs: sc_version
name: Get tools image
permissions:
contents: write
packages: read
uses: siliconcompiler/siliconcompiler/.github/workflows/docker_image.yml@main
with:
sc_version: ${{ needs.sc_version.outputs.version }}
lint_RTL:
needs: docker_image
name: Check RTL
if: false
runs-on: ubuntu-latest
container:
image: ${{ needs.docker_image.outputs.sc_tool }}
strategy:
fail-fast: false
matrix:
tool: ['verilator', 'slang']
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Install gallery
run: |
python3 -m venv .venv
. .venv/bin/activate
pip3 install --upgrade pip
pip3 install .
- name: Run lint
run: |
. .venv/bin/activate
sc-gallery -lint -lint_tool ${{ matrix.tool }}