-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (113 loc) · 3.94 KB
/
workflow.base.yaml
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
---
# https://docs.github.com/en/actions/guides/building-and-testing-python
name: Base Lint
on:
push:
branches:
- main
- master
pull_request:
jobs:
base:
#runs-on: ubuntu-latest
runs-on: ubuntu-20.04
# Note with this version testing you do not need tox in the cloud
strategy:
matrix:
# 3.7 will not run with the current requirements.txt pinning
# we do not need matrix that is in python version
python-version: [ 3.9 ]
steps:
# checkout repo under $GITHUB_WORKSPACE
- name: Checkout action
uses: actions/checkout@v2
with:
lfs: true
#submodules should be tested one at a time
#submodules: recursive
# install latest python version
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python --version
- name: Cache pip
uses: actions/cache@v2
with:
# Ubuntu specific path
path: ~/.cache/pip
# https://github.com/actions/cache/blob/main/examples.md#python---pip
# See if there is a cache hit looking for the requirements.txt
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
if [ -f python/requirements.txt ]; then pip install -r python/requirements.txt; fi
# https://snapcraft.io/install/shfmt/ubuntu
- name: Install ubuntu dependencies for shfmt and mdl
run: |
sudo apt update
sudo apt install snapd
sudo snap install shfmt mdl
# Not needed there is a snap package
# install dependencies for ruby gem mdl
# https://github.com/ruby/setup-ruby
#- name: Install ruby
#uses: ruby/setup-ruby@v1
#with:
#ruby-version: 3.0
#- name: Install Gems
#run: |
#gem install mdl
# install dependencies for markdownlint-cli
- name: Install node
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install markdownlint-cli
run: npm install -g markdownlint-cli
# https://github.com/pre-commit/action
- name: Run Pre-commit
uses: pre-commit/[email protected]
# No longer needed in pre-commit so edit .pre-commit-config.yaml
# and you do not need to duplicate all these actions
#- name: Lint with flake8
#run: |
#pip install flake8
#flake8 --exclude ./model ./python
# No longer needed in pre-commit
#- name: Lint with mypy
#run: |
#pip install mypy
#mypy --namespace-packages $(find . -name "*.py")
# No longer needed in pre-commit
#- name: Lint with bandit
#run: |
#pip install bandit
#bandit $(find . -type d \( -path "./.env" -o -path "./lambda_stage" \) -prune -false \
#-o -name "*.py" -a -not -name "test_*")
# No longer needed in pre-commit
#- name: Lint with pydocstyle
#run: |
#pip install pydocstyle
#pydocstyle --convention=google $(find . -name "*.py")
# No longer needed in pre-commit
#- name: Reformat with black
#uses: psf/black@stable
# A custom action https://github.com/marketplace/actions/yaml-lint
# Causes some strange file to get linted
#- name: Lint with yamllint action
#uses: ibiqlik/[email protected]
#with:
#file_or_dir: .
# you need all config files valid for this to work
#- name: Lint with yamllint
#run: |
#pip install yamllint
#yamllint $(find . -name "*.yaml" -o -name "*.yml")
#echo running yamllint
#yamllint .