-
Notifications
You must be signed in to change notification settings - Fork 30
75 lines (75 loc) · 2.4 KB
/
presubmit.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
# Checks code that code meets requirements for a pull request.
# Any automated checks for code quality and compliance belongs here.
name: presubmit
on: [push, pull_request]
jobs:
check:
name: Source checks
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
# Always clone the full depth so git-describe works.
fetch-depth: 0
submodules: true
- name: Set up Python
uses: actions/setup-python@v2
- name: Install dependencies
run: |
sudo apt update
sudo apt install clang-format
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Python style check
run: |
make format lint
test $(git status --porcelain | wc -l) -eq 0 || { git diff; false; }
- name: C++ style check
run: |
make format-cpp
test $(git status --porcelain | wc -l) -eq 0 || { git diff; false; }
- name: Check license
run: make check-license
- name: Python checks
run: make check-python-scripts
test:
name: Test Python package
runs-on: ubuntu-20.04
strategy:
matrix:
antlr_runtime_type: [static, shared]
python_version: [3.5, 3.6, 3.7, 3.8, 3.9]
include:
- python-version: 3.5
TOXENV: py35
- python-version: 3.6
TOXENV: py36
- python-version: 3.7
TOXENV: py37
- python-version: 3.8
TOXENV: py38
- python-version: 3.9
TOXENV: py39
fail-fast: false
steps:
- uses: actions/checkout@v2
with:
# Always clone the full depth so git-describe works.
fetch-depth: 0
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt update
sudo apt install cmake default-jre-headless uuid-dev libantlr4-runtime-dev
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python update_version.py
- name: Tox
run: |
export CMAKE_BUILD_PARALLEL_LEVEL=1
export ANTLR4_RUNTIME_TYPE=${{ matrix.antlr_runtime_type }}
tox -e ${{ matrix.TOXENV }}