Skip to content

Commit

Permalink
Create compile-python.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
OseMine authored Oct 24, 2024
1 parent 413bdad commit f09158c
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/compile-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Compile Python to C

on:
push:
branches:
- main
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install Cython
run: pip install cython

- name: Check GCC version
run: gcc --version

- name: Convert Python to C with Cython
run: |
for file in *.py; do
cython --embed "$file" -o "${file%.py}.c"
done
- name: Compile C files with GCC
run: |
for file in *.c; do
gcc "$file" -o "${file%.c}" $(python3-config --cflags --ldflags)
done

0 comments on commit f09158c

Please sign in to comment.