@@ -449,15 +449,17 @@ jobs:
449449# BUILD INSIDE DOCKER
450450# ------------------------------------------------------------------------------
451451 docker :
452- runs-on : ubuntu-22.04
453- name : ${{ matrix.config.name }} @${{ matrix.arch }}
452+ runs-on : ${{ matrix.os }}
453+ name : ${{ matrix.config.name }} @${{ matrix.os }} (${{ matrix.os == 'ubuntu-22.04-arm' && 'arm64' || 'amd64' }})
454454 continue-on-error : false
455+ container :
456+ image : andreasfertig/cppinsights-builder
455457 strategy :
456458 fail-fast : false
457459 matrix :
458- arch :
459- - arm64
460- - amd64
460+ os :
461+ - ubuntu-22.04
462+ - ubuntu-22.04-arm
461463
462464 config :
463465 # GCC 14 / LLVM 20
@@ -514,82 +516,47 @@ jobs:
514516 }
515517
516518 steps :
519+ - name : Set environment variable
520+ run : |
521+ if [ "${{ matrix.os }}" == "ubuntu-22.04-arm" ]; then
522+ echo "ARCH=arm64" >> $GITHUB_ENV
523+ else
524+ echo "ARCH=amd64" >> $GITHUB_ENV
525+ fi
517526 - uses : actions/checkout@v4
518527 with :
519528 path : cppinsights
520529
521- - name : Create docker shell
522- shell : bash
523- run : |
524- cat > docker-shell << "EOF"
525- #! /bin/bash
526- cp $1 ./__cmd.sh
527-
528- docker run \
529- --rm \
530- -v "/var/run/docker.sock":"/var/run/docker.sock" \
531- -v "/home/runner/work/_temp/_github_home":"/github/home" \
532- -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" \
533- -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" \
534- -v "/home/runner/work/cppinsights/cppinsights":"/github/workspace" \
535- --workdir /github/workspace \
536- --user $(id -u):$(id -g) \
537- --platform linux/${{ matrix.arch }} \
538- andreasfertig/cppinsights-builder \
539- /bin/bash -e ./__cmd.sh
540- EOF
541-
542- sudo mv docker-shell /usr/bin/docker-shell
543- sudo chmod 0755 /usr/bin/docker-shell
544-
545- - name : Set up QEMU
546- if : matrix.arch == 'arm64'
547- uses : docker/setup-qemu-action@v3
548- with :
549- platforms : arm64
550-
551530 - name : Configure
552531 id : cmake_configure
553- shell : docker-shell {0}
554532 run : |
555533 mkdir build
556534 cd build
557535
558536 CXX=${{ matrix.config.cxx }} cmake -G Ninja -DINSIGHTS_STATIC=${{ matrix.config.static }} -DDEBUG=${{ matrix.config.debug }} -DINSIGHTS_COVERAGE=${{ matrix.config.coverage }} -DINSIGHTS_USE_LIBCPP=${{ matrix.config.libcxx }} ../cppinsights
559537
560538 - name : Build
561- shell : docker-shell {0}
562539 run : |
563540 cmake --build build
564541
565542 - name : Simple test
566543 if : " ((matrix.config.coverage != 'Yes') && (matrix.config.run_tests != 'Yes'))"
567- shell : docker-shell {0}
544+ shell : bash
568545 run : |
569546 ./build/insights cppinsights/tests/SimpleCICompileTest.cpp
570547 ./build/insights --use-libc++ cppinsights/tests/SimpleCICompileTest.cpp
571548
572549 - name : Run tests
573550 if : matrix.config.run_tests == 'Yes'
574551 id : run_tests
575- shell : docker-shell {0}
576552 run : |
577553 cmake --build build --target tests
578554
579- # docker-shell fails building doc with an unknown reason. Use the original container
580- - name : Make docs 1/2
581- if : " ((matrix.arch == 'amd64') && (matrix.config.docs == 'Yes'))"
582- uses : docker://andreasfertig/cppinsights-builder:latest
583- with :
584- args : |
585- /bin/bash -c "cmake --build build --target doc"
586-
587- - name : Make docs 2/2
588- if : " ((matrix.arch == 'amd64') && (matrix.config.docs == 'Yes'))"
589- working-directory : ${{ github.workspace }}/build
555+ - name : Make docs
590556 shell : bash
591- run : |
592- sudo chown -R $(id -u):$(id -g) ${GITHUB_WORKSPACE}/build/
557+ if : " ((env.ARCH == 'amd64') && (matrix.config.docs == 'Yes'))"
558+ run :
559+ cmake --build build --target doc
593560 ls -l ${GITHUB_WORKSPACE}/build/
594561 ls -l ${GITHUB_WORKSPACE}/build/html
595562 mkdir -p ${GITHUB_WORKSPACE}/build/archive
@@ -598,7 +565,6 @@ jobs:
598565 - name : Run coverage
599566 if : matrix.config.coverage == 'Yes'
600567 id : run_coverage
601- shell : docker-shell {0}
602568 run : |
603569 cmake --build build --target coverage
604570 rm -f build/coverage.info
@@ -611,7 +577,7 @@ jobs:
611577 token : ${{ secrets.CODECOV_TOKEN }}
612578 files : ./build/filtered.info # don't use a absolute path on Windows with gitBash.
613579 exclude : build
614- flags : ${{ matrix.config.archive_name }}-${{ matrix.arch }}-libcxx-${{ matrix.config.libcxx }}
580+ flags : ${{ matrix.config.archive_name }}-${{ env.ARCH }}-libcxx-${{ matrix.config.libcxx }}
615581 disable_search : true
616582 fail_ci_if_error : true
617583
@@ -622,13 +588,13 @@ jobs:
622588 run : |
623589 mkdir -p ${GITHUB_WORKSPACE}/build/archive
624590
625- tar -cvzf ${GITHUB_WORKSPACE}/build/archive/${{ matrix.config.archive_name }}-${{ matrix.arch }} .tar.gz ${{ matrix.config.bin_name }}
626- sha256sum ${GITHUB_WORKSPACE}/build/${{ matrix.config.bin_name }} > ${GITHUB_WORKSPACE}/build/archive/${{ matrix.config.archive_name }}-${{ matrix.arch }} .sha256
591+ tar -cvzf ${GITHUB_WORKSPACE}/build/archive/${{ matrix.config.archive_name }}-$ARCH .tar.gz ${{ matrix.config.bin_name }}
592+ sha256sum ${GITHUB_WORKSPACE}/build/${{ matrix.config.bin_name }} > ${GITHUB_WORKSPACE}/build/archive/${{ matrix.config.archive_name }}-$ARCH .sha256
627593
628594 - uses : actions/upload-artifact@v4
629595 if : matrix.config.upload == 'Yes'
630596 with :
631- name : insights-artifact-ubuntu-${{ matrix.arch }}
597+ name : insights-artifact-ubuntu-${{ env.ARCH }}
632598 if-no-files-found : error
633599 path : |
634600 ${{ github.workspace }}/build/archive/*
0 commit comments