Skip to content

Commit 5718ade

Browse files
committed
Use ubuntu-22.04-arm instead of QEMU.
1 parent e10a311 commit 5718ade

File tree

1 file changed

+32
-57
lines changed

1 file changed

+32
-57
lines changed

.github/workflows/ci.yml

Lines changed: 32 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -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 == '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,48 @@ jobs:
514516
}
515517

516518
steps:
517-
- uses: actions/checkout@v4
518-
with:
519-
path: cppinsights
520-
521-
- name: Create docker shell
519+
- name: Set environment variable
522520
shell: bash
523521
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
522+
if [[ "${{ matrix.os }}" == "ubuntu-22.04-arm" ]]; then
523+
echo "ARCH=arm64" >> $GITHUB_ENV
524+
else
525+
echo "ARCH=amd64" >> $GITHUB_ENV
526+
fi
527+
- uses: actions/checkout@v4
548528
with:
549-
platforms: arm64
529+
path: cppinsights
550530

551531
- name: Configure
552532
id: cmake_configure
553-
shell: docker-shell {0}
554533
run: |
555534
mkdir build
556535
cd build
557536
558537
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
559538
560539
- name: Build
561-
shell: docker-shell {0}
562540
run: |
563541
cmake --build build
564542
565543
- name: Simple test
566544
if: "((matrix.config.coverage != 'Yes') && (matrix.config.run_tests != 'Yes'))"
567-
shell: docker-shell {0}
545+
shell: bash
568546
run: |
569547
./build/insights cppinsights/tests/SimpleCICompileTest.cpp
570548
./build/insights --use-libc++ cppinsights/tests/SimpleCICompileTest.cpp
571549
572550
- name: Run tests
573551
if: matrix.config.run_tests == 'Yes'
574552
id: run_tests
575-
shell: docker-shell {0}
576553
run: |
577554
cmake --build build --target tests
578555
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
556+
- name: Make docs
590557
shell: bash
558+
if: "((env.ARCH == 'amd64') && (matrix.config.docs == 'Yes'))"
591559
run: |
592-
sudo chown -R $(id -u):$(id -g) ${GITHUB_WORKSPACE}/build/
560+
cmake --build build --target doc
593561
ls -l ${GITHUB_WORKSPACE}/build/
594562
ls -l ${GITHUB_WORKSPACE}/build/html
595563
mkdir -p ${GITHUB_WORKSPACE}/build/archive
@@ -598,22 +566,29 @@ jobs:
598566
- name: Run coverage
599567
if: matrix.config.coverage == 'Yes'
600568
id: run_coverage
601-
shell: docker-shell {0}
602569
run: |
603570
cmake --build build --target coverage
604571
rm -f build/coverage.info
605572
573+
- name: Run download codecov
574+
if: matrix.config.coverage == 'Yes'
575+
working-directory: ${{ github.workspace }}
576+
run: |
577+
curl -O --retry 5 --retry-delay 2 "https://cli.codecov.io/latest/linux/codecov"
578+
chmod +x ./codecov
579+
606580
- name: Upload code coverage info
607581
if: matrix.config.coverage == 'Yes'
608582
id: run_coverage_upload
609-
uses: codecov/codecov-action@v4
583+
uses: codecov/codecov-action@v5
610584
with:
611585
token: ${{ secrets.CODECOV_TOKEN }}
612586
files: ./build/filtered.info # don't use a absolute path on Windows with gitBash.
613587
exclude: build
614-
flags: ${{ matrix.config.archive_name }}-${{ matrix.arch }}-libcxx-${{ matrix.config.libcxx }}
588+
flags: ${{ matrix.config.archive_name }}-${{ env.ARCH }}-libcxx-${{ matrix.config.libcxx }}
615589
disable_search: true
616590
fail_ci_if_error: true
591+
binary: ${{ github.workspace }}/codecov # Currently, the docker container comes without gpg
617592

618593
- name: Create archive
619594
if: matrix.config.upload == 'Yes'
@@ -622,13 +597,13 @@ jobs:
622597
run: |
623598
mkdir -p ${GITHUB_WORKSPACE}/build/archive
624599
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
600+
tar -cvzf ${GITHUB_WORKSPACE}/build/archive/${{ matrix.config.archive_name }}-$ARCH.tar.gz ${{ matrix.config.bin_name }}
601+
sha256sum ${GITHUB_WORKSPACE}/build/${{ matrix.config.bin_name }} > ${GITHUB_WORKSPACE}/build/archive/${{ matrix.config.archive_name }}-$ARCH.sha256
627602
628603
- uses: actions/upload-artifact@v4
629604
if: matrix.config.upload == 'Yes'
630605
with:
631-
name: insights-artifact-ubuntu-${{ matrix.arch }}
606+
name: insights-artifact-ubuntu-${{ env.ARCH }}
632607
if-no-files-found: error
633608
path: |
634609
${{ github.workspace }}/build/archive/*

0 commit comments

Comments
 (0)