ci updated

This commit is contained in:
Nicolas 2025-10-07 23:21:53 +02:00
parent a15bfc295e
commit a6f881ab34
3 changed files with 39 additions and 39 deletions

View File

@ -7,25 +7,6 @@ on:
branches: [main]
jobs:
build_stencils:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install cross compilers
run: |
sudo apt-get update
sudo apt-get install -y mingw-w64
- name: Build ops obj files
run: |
bash src/copapy/obj/nativecompile.sh
- uses: actions/upload-artifact@v4
with:
name: stencil-object-files
path: src/copapy/obj/*.o
build-ubuntu:
needs: [build_stencils]
runs-on: ubuntu-latest
@ -38,21 +19,15 @@ jobs:
- name: Check out code
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: stencil-object-files
path: src/copapy/obj
- name: Install compiler
run: |
sudo apt-get update
sudo apt-get install -y gcc-12-mingw-w64-x86-64
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Build ops obj files
run: |
bash src/copapy/obj/nativecompile.sh
- name: Install Python dependencies
run: python -m pip install -e .[dev]
@ -70,15 +45,19 @@ jobs:
#- name: Lint code with flake8
# run: flake8
- name: Upload compiled runner
uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v4
if: strategy.job-index == 0
with:
name: stencil-object-files-linux
path: src/copapy/obj/*.o
- uses: actions/upload-artifact@v4
if: strategy.job-index == 0
with:
name: runner-linux
path: bin/*
build-windows:
needs: [build_stencils]
runs-on: windows-latest
strategy:
@ -99,6 +78,10 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Build ops obj files
run: |
bash src/copapy/obj/nativecompile_win.sh
- name: Install Python dependencies
run: python -m pip install -e .[dev]
@ -123,8 +106,14 @@ jobs:
#- name: Lint code with flake8
# run: flake8
- name: Upload compiled runner
uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v4
if: strategy.job-index == 0
with:
name: stencil-object-files-win
path: src/copapy/obj/*.o
- uses: actions/upload-artifact@v4
if: strategy.job-index == 0
with:
name: runner-win
path: bin/*

View File

@ -12,8 +12,3 @@ gcc-12 -c $SRC -O0 -o $DEST/stencils_x86_64_O0.o
gcc-12 -c $SRC -O1 -o $DEST/stencils_x86_64_O1.o
gcc-12 -c $SRC -O2 -o $DEST/stencils_x86_64_O2.o
gcc-12 -c $SRC -O3 -o $DEST/stencils_x86_64_O3.o
x86_64-w64-mingw32-gcc --version
# Windows x86_64 (ARM64)
x86_64-w64-mingw32-gcc -O3 -c $SRC -o $DEST/stencils_AMD64_$OPT.o

View File

@ -0,0 +1,16 @@
#!/bin/bash
set -e
set -v
SRC=src/copapy/stencils.c
DEST=src/copapy/obj
python src/copapy/generate_stencils.py
mkdir -p $DEST
x86_64-w64-mingw32-gcc -c $SRC -O0 -o $DEST/stencils_AMD64_O0.o
x86_64-w64-mingw32-gcc -c $SRC -O1 -o $DEST/stencils_AMD64_O1.o
x86_64-w64-mingw32-gcc -c $SRC -O2 -o $DEST/stencils_AMD64_O2.o
x86_64-w64-mingw32-gcc -c $SRC -O3 -o $DEST/stencils_AMD64_O3.o
x86_64-w64-mingw32-gcc --version