forked from sscpac/statick
-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (116 loc) · 4.5 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
---
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, windows-latest]
python-version: ['3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/cache@v3
if: startsWith(runner.os, 'macOS')
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/cache@v3
if: startsWith(runner.os, 'Windows')
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade -r requirements.txt
python -m pip install --upgrade mypy
python -m pip install --upgrade setuptools
python -m pip install --upgrade tox
python -m pip install --upgrade tox-gh-actions
python -m pip install --upgrade types-deprecated
python -m pip install --upgrade types-PyYAML
python -m pip install --upgrade types-tabulate
python -m pip install --upgrade wheel
# 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: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04'
run: |
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
# Use apt-get instead of apt as apt does not have a stable CLI interface. The apt tool prints out
# "WARNING: apt does not have a stable CLI interface. Use with caution in scripts."
- name: Install tools (Linux)
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install cccc
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 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
- 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
# Have to install newer version from non-apt source due to SSL library compatibility issues.
- name: Install node
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04'
run: |
npm install -g [email protected]
npm install -g npm-groovy-lint
- name: Test with mypy
run: |
mypy --ignore-missing-imports --strict statick statick_tool/
- name: Statick markdown
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04'
run: |
statick . --check --profile documentation.yaml
- name: Sphinx lint
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu.22.04'
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@v3
with:
fail_ci_if_error: false
- name: Self check
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04'
run: |
mkdir statick-output
./statick . --output-directory statick-output --check --profile self_check.yaml --log INFO