From a6f881ab346afbba9fdb71609baaa0a712b4cefb Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 7 Oct 2025 23:21:53 +0200 Subject: [PATCH] ci updated --- .github/workflows/ci.yml | 57 ++++++++++++----------------- src/copapy/obj/nativecompile.sh | 5 --- src/copapy/obj/nativecompile_win.sh | 16 ++++++++ 3 files changed, 39 insertions(+), 39 deletions(-) create mode 100644 src/copapy/obj/nativecompile_win.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2744a93..521138e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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/* \ No newline at end of file diff --git a/src/copapy/obj/nativecompile.sh b/src/copapy/obj/nativecompile.sh index 3f88cdd..6c6f8c9 100644 --- a/src/copapy/obj/nativecompile.sh +++ b/src/copapy/obj/nativecompile.sh @@ -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 \ No newline at end of file diff --git a/src/copapy/obj/nativecompile_win.sh b/src/copapy/obj/nativecompile_win.sh new file mode 100644 index 0000000..588eb38 --- /dev/null +++ b/src/copapy/obj/nativecompile_win.sh @@ -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