Skip to content

Commit

Permalink
Merge pull request #496 from biojppm/ci/archs
Browse files Browse the repository at this point in the history
Ci/archs
  • Loading branch information
biojppm authored Feb 7, 2025
2 parents d8f4d01 + 33fd0f8 commit 297a0eb
Show file tree
Hide file tree
Showing 11 changed files with 231 additions and 138 deletions.
2 changes: 0 additions & 2 deletions .github/workflows-in/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,11 @@ force:


../workflows/%.yml: %.ys $(YS) $(INPUT_FILES)
@chmod u+w ../workflows
@if [ -f "$@" ] ; then chmod a+w $@ ; fi
@echo "# DO NOT EDIT - GENERATED FROM .github/workflows/$<" > $@
@echo >> $@
$(YS) -Y $< >> $@
@chmod a-w $@
@chmod u-w ../workflows
@wc -lm --total=never $< $@


Expand Down
6 changes: 3 additions & 3 deletions .github/workflows-in/infra.ys
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ jobs:
steps:
- :: checkout-action
- name: install ys
run: make -C .github/workflows install-ys
run: make -C .github/workflows-in install-ys
- name: generate workflows
run: make -C .github/workflows build
run: make -C .github/workflows-in build
- name: test workflows
run: |
wc --version
wc --help
make -C .github/workflows test
make -C .github/workflows-in test
status=$?
if [ $status != 0 ] ; then
echo "ERROR: generated workflows are out of date"
Expand Down
58 changes: 38 additions & 20 deletions .github/workflows-in/rarearchs.ys
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,46 @@
:: workflow-setup()

jobs:
rarearchs:
:: setup-job('rarearchs' 'rarearchs')
name: ${{matrix.arch}}/c++${{matrix.std}}/${{matrix.bt}}
runs-on: ubuntu-22.04
xcompile:
:: setup-job('rarearchs' 'xcompile')
name: ${{matrix.arch}}
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include::
? for
arch qw(aarch64 ppc64le s390x)
std [11 14 17]
bt qw(Debug Release)
: !
std:: std
bt:: bt
arch:: arch
include:
- {arch: aarch64 , tc: aarch64-linux-gnu} # this is armv8
- {arch: armv7 , tc: arm-linux-gnueabihf, flags: -march=armv7+fp}
- {arch: armv6 , tc: arm-linux-gnueabi, flags: -march=armv6+fp}
- {arch: armv5 , tc: arm-linux-gnueabi, flags: -march=armv5te+fp}
- {arch: armv4 , tc: arm-linux-gnueabi, flags: -march=armv4}
- {arch: loongarch64, tc: loongarch64-linux-gnu, version: -14}
- {arch: mips , tc: mips-linux-gnu}
- {arch: mipsel , tc: mipsel-linux-gnu}
- {arch: mips64 , tc: mips64-linux-gnuabi64}
- {arch: mips64el , tc: mips64el-linux-gnuabi64}
- {arch: riscv64 , tc: riscv64-linux-gnu}
- {arch: s390x , tc: s390x-linux-gnu}
- {arch: ppc , tc: powerpc-linux-gnu}
- {arch: ppc64 , tc: powerpc64-linux-gnu}
- {arch: ppc64le , tc: powerpc64le-linux-gnu}
- {arch: sparc64 , tc: sparc64-linux-gnu}
# TODO xtensa!
steps:
- :: checkout-action
- name: test
uses: uraimo/[email protected]
with:
arch: ${{matrix.arch}}
distro: ubuntu22.04
install:: bash('rarearchs-test-install')
run:: bash('rarearchs-test-run')
- name: install
run: |
sudo apt-get update
sudo apt-get install -y \
gcc${{matrix.version}}-${{matrix.tc}} \
g++${{matrix.version}}-${{matrix.tc}} \
qemu-user-static
- name: info
run: |
${{matrix.tc}}-g++${{matrix.version}} --version
${{matrix.tc}}-g++${{matrix.version}} -dM -E - </dev/null | sort
${{matrix.tc}}-g++${{matrix.version}} ${{matrix.flags}} -dM -E - </dev/null | sort
- :: xcompile-steps("${{matrix.arch}}" "Debug" "11" "${{matrix.flags}}")
- :: xcompile-steps("${{matrix.arch}}" "Release" "11" "${{matrix.flags}}")
- :: xcompile-steps("${{matrix.arch}}" "Debug" "20" "${{matrix.flags}}")
- :: xcompile-steps("${{matrix.arch}}" "Release" "20" "${{matrix.flags}}")
2 changes: 1 addition & 1 deletion .github/workflows-in/release.ys
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ jobs:

#----------------------------------------------------------------------------
merge_artifacts:
:: setup-job('release' 'release')
:: setup-job('release' 'merge_artifacts')
runs-on: ubuntu-latest
needs: [src, cpp, python_src, python_wheels]
steps:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows-in/windows.ys
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ items =::
- {std: 20, name: vs2022/32, os: 2022, gen: Visual Studio 17 2022, arch: Win32}

jobs:

vsdebug:
:: setup-job('windows' 'vsdebug')
name: ${{matrix.name}}bit/c++${{matrix.std}}/debug
Expand All @@ -30,6 +31,7 @@ jobs:
- :: run-vs-manual-with-flags('${{matrix.gen}}' '${{matrix.arch}}' 'Debug' 'ON' '/MDd /Zi /Ob0 /Od /RTC1')
- :: run-vs-manual-with-flags('${{matrix.gen}}' '${{matrix.arch}}' 'Debug' 'OFF' '/MDd /Zi /Ob0 /Od /RTC1')
- :: run-vs-manual-with-flags('${{matrix.gen}}' '${{matrix.arch}}' 'Release' 'OFF' '/MD /Os /DNDEBUG')

vsrelease:
:: setup-job('windows' 'vsrelease')
name: ${{matrix.name}}bit/c++${{matrix.std}}/release
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows-in/ys/common.ys
Original file line number Diff line number Diff line change
Expand Up @@ -324,3 +324,33 @@ defn run-vs-manual-with-flags(gen arch buildtype shared flags="")::
- name:: "run $buildtype ::: $flags shared=$shared"
run:: |
cmake --build build/$buildtype --target ryml-test-run


#----------------------------------------------------------

defn xcompile-steps(arch buildtype std flags="")::
- name: "-------------------------------------------------"
run:: "echo $arch/c++$std/$buildtype"
- name:: "configure $arch/c++$std/$buildtype"
run:: |
touch build
rm -rf build
export C4_EXTERN_DIR=`pwd`/build/extern
cmake -S . -B build \
-DCMAKE_TOOLCHAIN_FILE=ext/c4core/.github/toolchains/${{matrix.arch}}.cmake \
-DCMAKE_BUILD_TYPE=$buildtype \
-DCMAKE_CXX_FLAGS=" $flags" \
-DCMAKE_C_FLAGS=" $flags" \
-DC4_CXX_STANDARD=$std \
-DCXX_STANDARD=$std \
-DRYML_DEV=ON \
-DRYML_BUILD_BENCHMARKS=OFF \
-DRYML_SANITIZE=OFF \
-DRYML_LINT=OFF \
-DRYML_VALGRIND=OFF
- name:: "build $arch/c++$std/$buildtype"
run: |
cmake --build build --parallel --target ryml-test-build --verbose
- name:: "test $arch/c++$std/$buildtype"
run: |
cmake --build build --target ryml-test-run
6 changes: 3 additions & 3 deletions .github/workflows/infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ jobs:
submodules: recursive
fetch-depth: 0
- name: install ys
run: make -C .github/workflows install-ys
run: make -C .github/workflows-in install-ys
- name: generate workflows
run: make -C .github/workflows build
run: make -C .github/workflows-in build
- name: test workflows
run: |
wc --version
wc --help
make -C .github/workflows test
make -C .github/workflows-in test
status=$?
if [ $status != 0 ] ; then
echo "ERROR: generated workflows are out of date"
Expand Down
Loading

0 comments on commit 297a0eb

Please sign in to comment.