feat: add logic to check user modification in trame-geos #390
Workflow file for this run
This file contains hidden or 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: geosPythonPackages CI | |
on: pull_request | |
# Cancels in-progress workflows for a PR when updated | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
# Checks if PR title follows conventional semantics | |
semantic_pull_request: | |
permissions: | |
pull-requests: write # for amannn/action-semantic-pull-request to analyze PRs and | |
statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR | |
contents: read | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check if the PR name has conventional semantics | |
if: github.event_name == 'pull_request' | |
uses: amannn/action-semantic-pull-request@v5.5.3 | |
id: lint_pr_title | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
wip: true | |
# Configure that a scope doesn't need to be provided. | |
requireScope: false | |
- name: Skip the check on main branch | |
if: github.ref_name == 'main' | |
run: | | |
echo "This is not a Pull-Request, skipping" | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
max-parallel: 3 | |
matrix: | |
python-version: ["3.10", "3.11", "3.12"] | |
package-name: | |
- geos-ats | |
- geos-mesh | |
- geos-posp | |
- geos-timehistory | |
- geos-trame | |
- geos-utils | |
- geos-xml-tools | |
- geos-xml-viewer | |
- hdf5-wrapper | |
- pygeos-tools | |
include: | |
- package-name: pygeos-tools | |
dependencies: "geos-utils geos-mesh" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: mpi4py/setup-mpi@v1 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Install package | |
# working-directory: ./${{ matrix.package-name }} | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install pytest yapf toml | |
DEPS="${{ matrix.dependencies || '' }}" | |
if [ -n "$DEPS" ]; then | |
echo "Installing additional dependencies: $DEPS" | |
for dep in $DEPS; do | |
python -m pip install ./$dep | |
done | |
fi | |
echo "Installing main package..." | |
python -m pip install ./${{ matrix.package-name }}/[test] | |
- name: Lint with yapf | |
# working-directory: ./${{ matrix.package-name }} | |
run: | | |
yapf -r --diff ./${{ matrix.package-name }} --style .style.yapf | |
- name: Test with pytest | |
#working-directory: ./${{ matrix.package-name }} | |
run: | |
# python -m pytest ./${{ matrix.package-name }} --doctest-modules --junitxml=junit/test-results.xml --cov-report=xml --cov-report=html | | |
# wrap pytest to avoid error when no tests in the package | |
sh -c 'python -m pytest ./${{ matrix.package-name }}; ret=$?; [ $ret = 5 ] && exit 0 || exit $ret' |