Skip to content

Update and rename main to main.yml #3

Update and rename main to main.yml

Update and rename main to main.yml #3

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