mirror of https://github.com/Nonannet/copapy.git
ci updated
This commit is contained in:
parent
2cb5499299
commit
dd90b61c7b
|
|
@ -65,21 +65,21 @@ jobs:
|
||||||
name: wheels-${{ matrix.os }}
|
name: wheels-${{ matrix.os }}
|
||||||
path: wheelhouse/*.whl
|
path: wheelhouse/*.whl
|
||||||
|
|
||||||
# publish:
|
publish:
|
||||||
# if: contains(github.ref, '-beta') == false
|
if: contains(github.ref, '-beta') == false
|
||||||
# needs: [build_wheels]
|
needs: [build_wheels]
|
||||||
# runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# steps:
|
steps:
|
||||||
# - name: Install Twine
|
- name: Install Twine
|
||||||
# run: pip install twine
|
run: pip install twine
|
||||||
|
|
||||||
# - uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
# with:
|
with:
|
||||||
# path: wheelhouse
|
path: wheelhouse
|
||||||
|
|
||||||
# - name: Publish to PyPI
|
- name: Publish to PyPI
|
||||||
# env:
|
env:
|
||||||
# TWINE_USERNAME: __token__
|
TWINE_USERNAME: __token__
|
||||||
# TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
||||||
#
|
|
||||||
# run: python -m twine upload wheelhouse/*
|
run: python -m twine upload wheelhouse/*
|
||||||
|
|
|
||||||
|
|
@ -30,11 +30,6 @@ jobs:
|
||||||
name: musl-object-files
|
name: musl-object-files
|
||||||
path: /object_files/musl_objects_*.*o
|
path: /object_files/musl_objects_*.*o
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: cross-runner
|
|
||||||
path: build/runner/coparun-*
|
|
||||||
|
|
||||||
build-ubuntu:
|
build-ubuntu:
|
||||||
needs: [build_stencils]
|
needs: [build_stencils]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
@ -52,11 +47,6 @@ jobs:
|
||||||
name: stencil-object-files
|
name: stencil-object-files
|
||||||
path: src/copapy/obj
|
path: src/copapy/obj
|
||||||
|
|
||||||
#- uses: actions/download-artifact@v4
|
|
||||||
# with:
|
|
||||||
# name: cross-runner
|
|
||||||
# path: build/runner
|
|
||||||
|
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
|
|
@ -65,46 +55,23 @@ jobs:
|
||||||
- name: Install Python dependencies
|
- name: Install Python dependencies
|
||||||
run: python -m pip install -e .[dev]
|
run: python -m pip install -e .[dev]
|
||||||
|
|
||||||
#- name: Install ARM binutils and qemu
|
|
||||||
# if: strategy.job-index == 0
|
|
||||||
# run: |
|
|
||||||
# echo "set man-db/auto-update false" | sudo debconf-communicate
|
|
||||||
# sudo dpkg-reconfigure man-db
|
|
||||||
# sudo apt-get update
|
|
||||||
# sudo apt-get install --no-install-recommends --no-install-suggests binutils-aarch64-linux-gnu qemu-user gcc-aarch64-linux-gnu libc6-dev-arm64-cross
|
|
||||||
|
|
||||||
- name: Compile coparun
|
- name: Compile coparun
|
||||||
run: |
|
run: |
|
||||||
mkdir -p build/runner
|
mkdir -p build/runner
|
||||||
gcc -O3 -DENABLE_BASIC_LOGGING -o build/runner/coparun src/coparun/runmem.c src/coparun/coparun.c src/coparun/mem_man.c
|
gcc -O3 -DENABLE_BASIC_LOGGING -o build/runner/coparun src/coparun/runmem.c src/coparun/coparun.c src/coparun/mem_man.c
|
||||||
# aarch64-linux-gnu-gcc -O3 -static -DENABLE_BASIC_LOGGING src/coparun/runmem.c src/coparun/coparun.c src/coparun/mem_man.c -o build/runner/coparun-aarch64
|
|
||||||
|
|
||||||
- name: Generate debug asm files
|
- name: Generate debug asm files
|
||||||
if: strategy.job-index == 0
|
if: strategy.job-index == 0
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
set -v
|
set -v
|
||||||
python tools/make_example.py
|
bash tools/create_asm.sh
|
||||||
|
|
||||||
echo "- Patch code..."
|
echo '<p>example</p>' >> $GITHUB_STEP_SUMMARY
|
||||||
build/runner/coparun build/runner/test.copapy build/runner/test.copapy.bin
|
python tools/clean_asm.py build/asm/example.asm >> $GITHUB_STEP_SUMMARY
|
||||||
#qemu-aarch64 build/runner/coparun-aarch64 build/runner/test-arm64.copapy build/runner/test-arm64.copapy.bin
|
|
||||||
|
|
||||||
objdump -D -b binary -m i386:x86-64 --adjust-vma=0x1000 build/runner/test.copapy.bin > build/runner/test.copapy.asm
|
echo '<p>stencils_x86_64_O3.o</p>' >> $GITHUB_STEP_SUMMARY
|
||||||
echo '<p>test.copapy.asm</p>' >> $GITHUB_STEP_SUMMARY
|
python tools/clean_asm.py build/asm/stencils.asm >> $GITHUB_STEP_SUMMARY
|
||||||
python tools/clean_asm.py build/runner/test.copapy.asm >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
#aarch64-linux-gnu-objdump -D -b binary -m aarch64 --adjust-vma=0x1000 build/runner/test-arm64.copapy.bin > build/runner/test-arm64.copapy.asm
|
|
||||||
#echo '<p>test-arm64.copapy.asm</p>' >> $GITHUB_STEP_SUMMARY
|
|
||||||
#python tools/clean_asm.py build/runner/test-arm64.copapy.asm >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
objdump -d -x src/copapy/obj/stencils_x86_64_O3.o > build/runner/stencils_x86_64_O3.asm
|
|
||||||
echo '<p>stencils_x86_64_O3.asm</p>' >> $GITHUB_STEP_SUMMARY
|
|
||||||
python tools/clean_asm.py build/runner/stencils_x86_64_O3.asm >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
#aarch64-linux-gnu-objdump -d -x src/copapy/obj/stencils_arm64_O3.o > build/runner/stencils_arm64_O3.asm
|
|
||||||
#echo '<p>stencils_arm64_O3.asm</p>' >> $GITHUB_STEP_SUMMARY
|
|
||||||
#python tools/clean_asm.py build/runner/stencils_arm64_O3.asm >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
- name: Run tests with pytest
|
- name: Run tests with pytest
|
||||||
run: pytest
|
run: pytest
|
||||||
|
|
@ -142,7 +109,8 @@ jobs:
|
||||||
mkdir -p build/runner && \
|
mkdir -p build/runner && \
|
||||||
gcc -O3 -DENABLE_LOGGING -o build/runner/coparun src/coparun/runmem.c \
|
gcc -O3 -DENABLE_LOGGING -o build/runner/coparun src/coparun/runmem.c \
|
||||||
src/coparun/coparun.c src/coparun/mem_man.c && \
|
src/coparun/coparun.c src/coparun/mem_man.c && \
|
||||||
pytest"
|
pytest && \
|
||||||
|
bash tools/create_asm.sh"
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
|
@ -170,7 +138,8 @@ jobs:
|
||||||
mkdir -p build/runner && \
|
mkdir -p build/runner && \
|
||||||
gcc -O3 -DENABLE_LOGGING -o build/runner/coparun src/coparun/runmem.c \
|
gcc -O3 -DENABLE_LOGGING -o build/runner/coparun src/coparun/runmem.c \
|
||||||
src/coparun/coparun.c src/coparun/mem_man.c && \
|
src/coparun/coparun.c src/coparun/mem_man.c && \
|
||||||
pytest"
|
pytest && \
|
||||||
|
bash tools/create_asm.sh"
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
|
@ -219,12 +188,6 @@ jobs:
|
||||||
- name: Run tests with pytest
|
- name: Run tests with pytest
|
||||||
run: pytest
|
run: pytest
|
||||||
|
|
||||||
- name: Type checking with mypy
|
|
||||||
run: mypy
|
|
||||||
|
|
||||||
#- name: Lint code with flake8
|
|
||||||
# run: flake8
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: strategy.job-index == 0
|
if: strategy.job-index == 0
|
||||||
with:
|
with:
|
||||||
|
|
@ -234,7 +197,7 @@ jobs:
|
||||||
release-stencils:
|
release-stencils:
|
||||||
needs: [build_stencils, build-ubuntu, build-windows, build-arm64, build-armv7]
|
needs: [build_stencils, build-ubuntu, build-windows, build-arm64, build-armv7]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.event_name == 'push'
|
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -262,7 +225,6 @@ jobs:
|
||||||
mkdir -p release
|
mkdir -p release
|
||||||
cp tmp/stencil-object-files/* release/
|
cp tmp/stencil-object-files/* release/
|
||||||
cp tmp/musl-object-files/* release/
|
cp tmp/musl-object-files/* release/
|
||||||
cp tmp/cross-runner/coparun-* release/
|
|
||||||
cp tmp/runner-linux/coparun release/
|
cp tmp/runner-linux/coparun release/
|
||||||
cp tmp/runner-linux-arm64/coparun release/coparun-aarch64
|
cp tmp/runner-linux-arm64/coparun release/coparun-aarch64
|
||||||
cp tmp/runner-linux-armv7/coparun release/coparun-armv7
|
cp tmp/runner-linux-armv7/coparun release/coparun-armv7
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -v
|
||||||
|
|
||||||
|
mkdir -p build/runner
|
||||||
|
|
||||||
|
arch=$(python3 -c "import copapy; print(copapy._stencils.detect_process_arch())")
|
||||||
|
|
||||||
|
# Disassemble stencil object file
|
||||||
|
objdump -d -x src/copapy/obj/stencils_${arch}_O3.o > build/runner/stencils.asm
|
||||||
|
|
||||||
|
# Create example code disassembly
|
||||||
|
python3 tools/make_example.py
|
||||||
|
build/runner/coparun build/runner/test.copapy build/runner/test.copapy.bin
|
||||||
|
|
||||||
|
if [ $(arch) = 'x86-64' ]; then
|
||||||
|
arch="i386:x86-64"
|
||||||
|
fi
|
||||||
|
|
||||||
|
objdump -D -b binary -m $arch --adjust-vma=0x10000 build/runner/test.copapy.bin > build/runner/example.asm
|
||||||
|
|
||||||
|
rm build/runner/test.copapy.bin
|
||||||
|
|
@ -58,10 +58,3 @@ arm-none-eabi-ld -r $STMP /object_files/musl_objects_armv7.o $LIBGCC -o $DEST/st
|
||||||
|
|
||||||
# RISCV 64 Bit
|
# RISCV 64 Bit
|
||||||
#riscv64-linux-gnu-gcc-13 $FLAGS -$OPT -c $SRC -o $DEST/stencils_riscv64_$OPT.o
|
#riscv64-linux-gnu-gcc-13 $FLAGS -$OPT -c $SRC -o $DEST/stencils_riscv64_$OPT.o
|
||||||
|
|
||||||
|
|
||||||
# -------------- Cross compile runner --------------
|
|
||||||
mkdir -p build/runner
|
|
||||||
|
|
||||||
# Aarch64
|
|
||||||
aarch64-linux-gnu-gcc-13 -static -O3 -DENABLE_LOGGING -o build/runner/coparun-aarch64 src/coparun/runmem.c src/coparun/coparun.c src/coparun/mem_man.c
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue