Skip to content

Commit

Permalink
CI: Add CI job to check if Python.h is included first.
Browse files Browse the repository at this point in the history
  • Loading branch information
DWesl authored Apr 17, 2024
1 parent 8b5f7fe commit c802c15
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/python-h-first.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Linux Meson tests

on:
push:
branches:
- maintenance/**
pull_request:
branches:
- main
- maintenance/**

permissions:
contents: read # to fetch code (actions/checkout)

env:
CCACHE_DIR: "${{ github.workspace }}/.ccache"
INSTALLDIR: "build-install"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
check-python-h-first:
name: Check Python.h before other headers
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
with:
submodules: recursive

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: 'environment.yml'

- name: Check that Python.h is first in any file including it.
shell: bash
run:
python tools/check_python_h_first.py $(find scipy -type f -iname \*.[ch] -o -name \*.[ch]pp -o -name \*.cc -o -name \*.hh -print)

0 comments on commit c802c15

Please sign in to comment.