-
Notifications
You must be signed in to change notification settings - Fork 14
148 lines (128 loc) · 4.92 KB
/
test.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
---
name: Statick
on: # NOLINT
pull_request:
push:
schedule:
- cron: '0 10 * * MON'
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, windows-latest]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
pip install --upgrade pip
pip install .[docs,test]
# Remove apt repos that are known to break from time to time.
# See https://github.com/actions/virtual-environments/issues/323
- name: Remove broken apt repos [Ubuntu]
if: runner.os == 'Linux'
run: |
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
- name: Install tools (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install cccc
sudo apt-get install chktex
sudo apt-get install clang
sudo apt-get install clang-format
sudo apt-get install clang-tidy
sudo apt-get install cppcheck
sudo apt-get install lacheck
sudo apt-get install libpcre3-dev
sudo apt-get install libperl-critic-perl
sudo apt-get install libxml2
sudo apt-get install libxml2-utils
sudo apt-get install shellcheck
sudo apt-get install uncrustify
git clone https://github.com/KCL-Planning/VAL
cd VAL/scripts/linux
sh build_linux64.sh all Release
cd ../../..
mkdir -p /opt/val/bin/
cp -r VAL/build/linux64/Release/install/bin/* /opt/val/bin/
rm -rf VAL
- name: Install clang tools (for unit tests)
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install clang-format-14
sudo apt-get install clang-tidy-14
# Do not install on macos until there is a hadolint release for macos (Darwin on arm64 architecture).
- name: Install Hadolint binary (github)
if: runner.os == 'Linux' || runner.os == 'Windows'
run: |
mkdir -p $HOME/.local/bin
echo "$HOME/.local/bin" >> $GITHUB_PATH
curl -sL -o hadolint https://github.com/hadolint/hadolint/releases/download/v2.6.0/hadolint-$(uname -s)-$(uname -m)
chmod +x hadolint
mv hadolint $HOME/.local/bin/
- name: Install Hadolint docker image (Linux)
if: runner.os == 'Linux'
run: |
docker pull hadolint/hadolint:latest
- name: Install node tools
if: runner.os == 'Linux'
run: |
npm install -g dockerfile_lint
npm install -g dockerfilelint
npm install -g htmllint-cli
npm install -g jshint
npm install -g markdownlint-cli
npm install -g npm-groovy-lint
npm install -g postcss-html # needed for stylelint to process html
npm install -g prettier
npm install -g stylelint
npm install -g stylelint-config-standard
npm install -g write-good
npm install -g eslint
# eslint plugins and configs should be installed locally
# https://eslint.org/docs/user-guide/migrating-to-6.0.0#plugins-and-shareable-configs-are-no-longer-affected-by-eslints-location
npm install --prefix $HOME/.node_modules --save-dev eslint-plugin-html
npm install --prefix $HOME/.node_modules --save-dev eslint-plugin-prettier
npm install --prefix $HOME/.node_modules --save-dev eslint-config-prettier
npm install --prefix $HOME/.node_modules --save-dev eslint @eslint/js
# View versions of installed packages
npm list
npm list --prefix $HOME/.node_modules
npm list -g
- name: Test with mypy
run: |
mypy --ignore-missing-imports --strict src/statick_tool/
- name: Statick markdown
if: runner.os == 'Linux'
run: |
statick . --check --level documentation --log info
- name: Sphinx lint
if: runner.os == 'Linux'
uses: ammaraskar/sphinx-action@master
with:
docs-folder: 'docs/'
- name: Test with tox
run: |
python -m tox
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
- name: Self check
if: runner.os == 'Linux'
run: |
mkdir statick-output
statick . --output-directory statick-output --check --profile self_check.yaml --log INFO