Skip to content

Build extension with CI actions #10

Build extension with CI actions

Build extension with CI actions #10

Workflow file for this run

# 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: Build terrain analysis extension
on:
push:
branches: [ "master" ]
paths-ignore: [ "fct/lib/terrain_analysis*" ]
pull_request:
branches: [ "master" ]
permissions:
contents: write
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python: ["3.10", "3.11", "3.12", "3.13"]
runs-on: ${{ matrix.os }}
env:
CI_COMMIT_MESSAGE: CI Build Extension ${{ matrix.os }}-${{ matrix.python }}
CI_COMMIT_AUTHOR: github-actions[bot]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}
- name: Install packages
run: |
python -m pip install --upgrade pip
pip install wheel numpy cython
pip install -e .
- name: Check if there are any changes
id: verify_diff
run: |
if [[ -n $(git status --porcelain) ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT";
fi
- name: GIT Commit Build Artifacts
if: steps.verify_diff.outputs.changed == 'true'
run: |
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
git config --global user.email "github-actions@users.noreply.github.com"
git add -A
git commit -a -m "${{ env.CI_COMMIT_MESSAGE }}"
git push