forked from finos/opengris-scaler
-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (91 loc) · 3.36 KB
/
linter.yml
File metadata and controls
112 lines (91 loc) · 3.36 KB
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python Linter And Unittest
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python 3.8
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.8"
- name: Install necessary component
run: |
sudo apt update -y
sudo apt upgrade -y
sudo DEBIAN_FRONTEND=noninteractive sudo apt install -y tzdata
# DEBIAN_FRONTEND=noninteractive apt install -y tzdata
# sudo apt install software-properties-common -y
sudo apt install cmake clang curl pkg-config -y
- name: Make scripts executable
run: |
sudo chmod 755 ./scripts/download_install_dependencies.sh
- name: Cache Boost
id: cache-boost
uses: actions/cache@v4
with:
path: boost
key: ${{ runner.os }}-cache-boost
- name: Download Boost if not cached
if: steps.cache-boost.outputs.cache-hit != 'true'
run: |
sudo ./scripts/download_install_dependencies.sh boost compile
- name: Install Boost
run: |
sudo ./scripts/download_install_dependencies.sh boost install
- name: Cache Capnp
id: cache-capnp
uses: actions/cache@v4
with:
path: capnp
key: ${{ runner.os }}-cache-capnp
- name: Download and Compile capnp if not cached
if: steps.cache-capnp.outputs.cache-hit != 'true'
run: |
sudo ./scripts/download_install_dependencies.sh capnp compile
- name: Install Capnp
run: |
sudo ./scripts/download_install_dependencies.sh capnp install
- name: Build Object Storage Component
run: |
cmake -S . -B build -DCMAKE_CXX_COMPILER=$(which clang++) -DCMAKE_BUILD_TYPE=Debug
cd build && make
ctest
- name: Install Python Dependent Packages
run: |
pip install uv
uv pip install --system --upgrade pip
uv pip install --system flake8 pyproject-flake8 mypy
uv pip install --system -r pyproject.toml
- name: Lint With flake8
run: |
pflake8 .
- name: Lint With MyPy
run: |
mypy --install-types --non-interactive .
- name: Run Python Unittests
run: |
python -m unittest discover -v tests
- name: Run Python Examples
run: |
uv pip install --system -r examples/applications/requirements_applications.txt
for example in "./examples"/*.py; do
echo "Running $example"
PYTHONPATH=. python $example
done
for example in "./examples/applications"/*.py; do
echo "Running $example"
PYTHONPATH=. python $example
done