-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (67 loc) · 2.06 KB
/
ci.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
name: CI
on:
push:
branches:
- main
paths-ignore:
- "requirements.txt"
- "requirements.dev.txt"
pull_request:
branches:
- main
jobs:
ci:
if: ${{ github.repository == 'HideBa/ahn_cli' }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11.1
- name: Install PDAL
run: |
sudo apt-get update
sudo apt-get install -y pdal libpdal-dev
- name: Cache pip packages
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
- name: Configure Poetry
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Install dependencies excluding PDAL
run: |
poetry add pdal --optional
poetry install --no-root
- name: Install PDAL Python package
run: |
source .venv/bin/activate
pip install pdal==3.2.3
- name: Linting
run: |
pip install pylint
pylint ./ahn_cli/**/*.py
- name: Type checking
run: |
pip install mypy
mypy ./ahn_cli/**/*.py
- name: Testing
run: pytest ./ahn_cli/**/*.py --cov=./ahn_cli
- name: Export requirements
run: |
poetry export --dev --format requirements.txt --output requirements.txt
poetry export --dev --format requirements.txt --output requirements.dev.txt
- name: Commit exported requirements
run: |
git config --global user.name "${{ secrets.GH_USER_NAME }}"
git config --global user.email "${{ secrets.GH_USER_EMAIL }}"
git add requirements.txt requirements.dev.txt
git commit -m "Update requirements"
git push origin main