forked from grapl-security/grapl
-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (105 loc) · 3.49 KB
/
grapl-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
name: Grapl Lint
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- staging
- master
jobs:
rust-format:
runs-on: ubuntu-latest
defaults:
run:
working-directory: src/rust
steps:
- uses: actions/checkout@v2
- name: Check Rust code formatting
# Github Workflow runners appear to already have rustup, but
# using a minimal profile, which runs afoul of the
# RUSTUP_TOOLCHAIN variable in bin/format, because `rustfmt`
# isn't included in the minimal profile :(
run: |
rustup set profile default
bin/format --check
rust-lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: src/rust
steps:
- uses: actions/checkout@v2
- name: Lint Rust Code
run: bin/lint
python-lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Run etc/ci/scripts/py_lint.sh --check-only
run: |
./etc/ci_scripts/py_lint.sh --check-only
- name: How to fix lint failure
if: ${{ failure() }}
run: echo "Run etc/ci_scripts/py_lint.sh without the flag. That's it!"
check-pypi:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install pypi-simple
run: |
python3 -mvenv venv && . venv/bin/activate
pip install pypi-simple
deactivate
- name: Export CHECK_PYPI_VERSION_ARGS as "true" if channel is not latest
# passing 'true' to check_pypi means "check test.pypi.org"
run: |
if [[ "$CHANNEL" == "latest" ]]; then
echo "CHECK_PYPI_VERSION_ARGS=false" >> $GITHUB_ENV
else
echo "CHECK_PYPI_VERSION_ARGS=true" >> $GITHUB_ENV
fi
- name: Check whether grapl_graph_descriptions version has been bumped
run: |
. venv/bin/activate
python etc/build_scripts/check_pypi_version.py \
grapl_graph_descriptions \
$(cat src/rust/graph-descriptions/VERSION) \
$CHECK_PYPI_VERSION_ARGS
deactivate
- name: Check whether grapl_analyzerlib version has been bumped
run: |
. venv/bin/activate
python etc/build_scripts/check_pypi_version.py \
grapl_analyzerlib \
$(cat src/python/grapl_analyzerlib/VERSION) \
$CHECK_PYPI_VERSION_ARGS
deactivate
- name: Check whether grapl-common version has been bumped
run: |
. venv/bin/activate
python etc/build_scripts/check_pypi_version.py \
grapl-common \
$(cat src/python/grapl-common/VERSION) \
$CHECK_PYPI_VERSION_ARGS
deactivate
- name: Check whether grapl-tests-common version has been bumped
run: |
. venv/bin/activate
python etc/build_scripts/check_pypi_version.py \
grapl-tests-common \
$(cat src/python/grapl-tests-common/VERSION) \
$CHECK_PYPI_VERSION_ARGS
deactivate