From 1601db5335c0557c0307d71d88b38c5e868cdfa9 Mon Sep 17 00:00:00 2001 From: Corentin Le Molgat Date: Wed, 27 Oct 2021 14:09:08 +0200 Subject: [PATCH] ci: Update Linux jobs to run inside a docker container. --- .github/workflows/aarch64_linux.yml | 9 ++---- .../{x86_freebsd.yml => amd64_freebsd.yml} | 2 +- .github/workflows/amd64_linux.yml | 31 +++++++++++++++++++ .../{x86_darwin.yml => amd64_macos.yml} | 2 +- .../{x86_windows.yml => amd64_windows.yml} | 2 +- .github/workflows/arm_linux.yml | 9 ++---- .github/workflows/mips_linux.yml | 9 ++---- .github/workflows/x86_linux.yml | 27 ---------------- README.md | 12 +++---- ci/README.md | 16 +++++----- 10 files changed, 54 insertions(+), 65 deletions(-) rename .github/workflows/{x86_freebsd.yml => amd64_freebsd.yml} (96%) create mode 100644 .github/workflows/amd64_linux.yml rename .github/workflows/{x86_darwin.yml => amd64_macos.yml} (98%) rename .github/workflows/{x86_windows.yml => amd64_windows.yml} (97%) delete mode 100644 .github/workflows/x86_linux.yml diff --git a/.github/workflows/aarch64_linux.yml b/.github/workflows/aarch64_linux.yml index c47b990..2de7289 100644 --- a/.github/workflows/aarch64_linux.yml +++ b/.github/workflows/aarch64_linux.yml @@ -20,14 +20,9 @@ jobs: fail-fast: false env: TARGET: ${{ matrix.targets[0] }} - CTEST_OUTPUT_ON_FAILURE: 1 steps: - uses: actions/checkout@v2 - - name: Install Ninja - run: | - sudo apt-get update - sudo apt-get install ninja-build - name: Build - run: ./scripts/run_integration.sh build + run: make --directory=ci ${TARGET}_build - name: Test - run: ./scripts/run_integration.sh test + run: make --directory=ci ${TARGET}_test diff --git a/.github/workflows/x86_freebsd.yml b/.github/workflows/amd64_freebsd.yml similarity index 96% rename from .github/workflows/x86_freebsd.yml rename to .github/workflows/amd64_freebsd.yml index 225f7a9..eeab380 100644 --- a/.github/workflows/x86_freebsd.yml +++ b/.github/workflows/amd64_freebsd.yml @@ -1,4 +1,4 @@ -name: x86 FreeBSD +name: amd64 FreeBSD on: push: diff --git a/.github/workflows/amd64_linux.yml b/.github/workflows/amd64_linux.yml new file mode 100644 index 0000000..21f4f90 --- /dev/null +++ b/.github/workflows/amd64_linux.yml @@ -0,0 +1,31 @@ +name: amd64 Linux + +on: + push: + pull_request: + schedule: + # min hours day(month) month day(week) + - cron: '0 0 7,22 * *' + +jobs: + # Building using the github runner environement directly. + make: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Env + run: make --directory=ci amd64_env + - name: Devel + run: make --directory=ci amd64_devel + - name: Build + run: make --directory=ci amd64_build + - name: Test + run: make --directory=ci amd64_test + - name: Install Env + run: make --directory=ci amd64_install_env + - name: Install Devel + run: make --directory=ci amd64_install_devel + - name: Install Build + run: make --directory=ci amd64_install_build + - name: Install Test + run: make --directory=ci amd64_install_test diff --git a/.github/workflows/x86_darwin.yml b/.github/workflows/amd64_macos.yml similarity index 98% rename from .github/workflows/x86_darwin.yml rename to .github/workflows/amd64_macos.yml index e15282c..19ec18c 100644 --- a/.github/workflows/x86_darwin.yml +++ b/.github/workflows/amd64_macos.yml @@ -1,4 +1,4 @@ -name: x86 Darwin +name: amd64 macOS on: push: diff --git a/.github/workflows/x86_windows.yml b/.github/workflows/amd64_windows.yml similarity index 97% rename from .github/workflows/x86_windows.yml rename to .github/workflows/amd64_windows.yml index bd6748a..2631db3 100644 --- a/.github/workflows/x86_windows.yml +++ b/.github/workflows/amd64_windows.yml @@ -1,4 +1,4 @@ -name: x86 Windows +name: amd64 Windows on: push: diff --git a/.github/workflows/arm_linux.yml b/.github/workflows/arm_linux.yml index 491af63..2272188 100644 --- a/.github/workflows/arm_linux.yml +++ b/.github/workflows/arm_linux.yml @@ -23,14 +23,9 @@ jobs: fail-fast: false env: TARGET: ${{ matrix.targets[0] }} - CTEST_OUTPUT_ON_FAILURE: 1 steps: - uses: actions/checkout@v2 - - name: Install Ninja - run: | - sudo apt-get update - sudo apt-get install ninja-build - name: Build - run: ./scripts/run_integration.sh build + run: make --directory=ci ${TARGET}_build - name: Test - run: ./scripts/run_integration.sh test + run: make --directory=ci ${TARGET}_test diff --git a/.github/workflows/mips_linux.yml b/.github/workflows/mips_linux.yml index 37bac2b..571de3a 100644 --- a/.github/workflows/mips_linux.yml +++ b/.github/workflows/mips_linux.yml @@ -22,14 +22,9 @@ jobs: fail-fast: false env: TARGET: ${{ matrix.targets[0] }} - CTEST_OUTPUT_ON_FAILURE: 1 steps: - uses: actions/checkout@v2 - - name: Install Ninja - run: | - sudo apt-get update - sudo apt-get install ninja-build - name: Build - run: ./scripts/run_integration.sh build + run: make --directory=ci ${TARGET}_build - name: Test - run: ./scripts/run_integration.sh test + run: make --directory=ci ${TARGET}_test diff --git a/.github/workflows/x86_linux.yml b/.github/workflows/x86_linux.yml deleted file mode 100644 index 1e86db6..0000000 --- a/.github/workflows/x86_linux.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: x86 Linux - -on: - push: - pull_request: - schedule: - # min hours day(month) month day(week) - - cron: '0 0 7,22 * *' - -jobs: - # Building using the github runner environement directly. - make: - runs-on: ubuntu-latest - env: - CTEST_OUTPUT_ON_FAILURE: 1 - steps: - - uses: actions/checkout@v2 - - name: Check cmake - run: cmake --version - - name: Configure - run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release - - name: Build - run: cmake --build build --target all -v - - name: Test - run: cmake --build build --target test -v - - name: Install - run: cmake --build build --target install -v -- DESTDIR=install diff --git a/README.md b/README.md index 48f9caa..a2b213f 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,12 @@ [![Macos Status][macos_svg]][macos_link] [![Windows Status][windows_svg]][windows_link] -[linux_svg]: https://github.com/google/cpu_features/actions/workflows/x86_linux.yml/badge.svg?branch=master -[linux_link]: https://github.com/google/cpu_features/actions/workflows/x86_linux.yml -[macos_svg]: https://github.com/google/cpu_features/actions/workflows/x86_darwin.yml/badge.svg?branch=master -[macos_link]: https://github.com/google/cpu_features/actions/workflows/x86_darwin.yml -[windows_svg]: https://github.com/google/cpu_features/actions/workflows/x86_windows.yml/badge.svg?branch=master -[windows_link]: https://github.com/google/cpu_features/actions/workflows/x86_windows.yml +[linux_svg]: https://github.com/google/cpu_features/actions/workflows/amd64_linux.yml/badge.svg?branch=master +[linux_link]: https://github.com/google/cpu_features/actions/workflows/amd64_linux.yml +[macos_svg]: https://github.com/google/cpu_features/actions/workflows/amd64_macos.yml/badge.svg?branch=master +[macos_link]: https://github.com/google/cpu_features/actions/workflows/amd64_macos.yml +[windows_svg]: https://github.com/google/cpu_features/actions/workflows/amd64_windows.yml/badge.svg?branch=master +[windows_link]: https://github.com/google/cpu_features/actions/workflows/amd64_windows.yml A cross-platform C library to retrieve CPU features (such as available instructions) at runtime. diff --git a/ci/README.md b/ci/README.md index a507c65..15de7a3 100644 --- a/ci/README.md +++ b/ci/README.md @@ -6,11 +6,11 @@ | MacOS | [![Status][macos_svg]][macos_link] | N/A | N/A | N/A | | Windows | [![Status][windows_svg]][windows_link] | N/A | N/A | N/A | -[freebsd_svg]: https://github.com/google/cpu_features/actions/workflows/x86_freebsd.yml/badge.svg?branch=master -[freebsd_link]: https://github.com/google/cpu_features/actions/workflows/x86_freebsd.yml +[freebsd_svg]: https://github.com/google/cpu_features/actions/workflows/amd64_freebsd.yml/badge.svg?branch=master +[freebsd_link]: https://github.com/google/cpu_features/actions/workflows/amd64_freebsd.yml -[linux_svg]: https://github.com/google/cpu_features/actions/workflows/x86_linux.yml/badge.svg?branch=master -[linux_link]: https://github.com/google/cpu_features/actions/workflows/x86_linux.yml +[linux_svg]: https://github.com/google/cpu_features/actions/workflows/amd64_linux.yml/badge.svg?branch=master +[linux_link]: https://github.com/google/cpu_features/actions/workflows/amd64_linux.yml [linux_aarch64_svg]: https://github.com/google/cpu_features/actions/workflows/aarch64_linux.yml/badge.svg?branch=master [linux_aarch64_link]: https://github.com/google/cpu_features/actions/workflows/aarch64_linux.yml [linux_arm_svg]: https://github.com/google/cpu_features/actions/workflows/arm_linux.yml/badge.svg?branch=master @@ -18,11 +18,11 @@ [linux_mips_svg]: https://github.com/google/cpu_features/actions/workflows/mips_linux.yml/badge.svg?branch=master [linux_mips_link]: https://github.com/google/cpu_features/actions/workflows/mips_linux.yml -[macos_svg]: https://github.com/google/cpu_features/actions/workflows/x86_darwin.yml/badge.svg?branch=master -[macos_link]: https://github.com/google/cpu_features/actions/workflows/x86_darwin.yml +[macos_svg]: https://github.com/google/cpu_features/actions/workflows/amd64_macos.yml/badge.svg?branch=master +[macos_link]: https://github.com/google/cpu_features/actions/workflows/amd64_macos.yml -[windows_svg]: https://github.com/google/cpu_features/actions/workflows/x86_windows.yml/badge.svg?branch=master -[windows_link]: https://github.com/google/cpu_features/actions/workflows/x86_windows.yml +[windows_svg]: https://github.com/google/cpu_features/actions/workflows/amd64_windows.yml/badge.svg?branch=master +[windows_link]: https://github.com/google/cpu_features/actions/workflows/amd64_windows.yml ## Makefile/Docker testing To test the build on various distro, we are using docker containers and a Makefile for orchestration.