ci: fix pdal install #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Install dependencies with Poetry | |
run: | | |
poetry install | |
- 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 |