1
0
mirror of https://github.com/google/cpu_features.git synced 2025-04-27 23:22:31 +02:00

Move ci folder and make naming more consistent (#233)

This commit is contained in:
Guillaume Chatelet 2022-03-15 13:26:25 +01:00 committed by GitHub
parent 70ca4fd06f
commit c219c921c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 83 additions and 110 deletions

View File

@ -1,8 +1,8 @@
# Project Files unneeded by docker
ci/Makefile
ci/docker
ci/doc
ci/cache
cmake/ci/Makefile
cmake/ci/docker
cmake/ci/doc
cmake/ci/cache
.git
.gitignore
.github

View File

@ -1,4 +1,4 @@
name: aarch64 Linux
name: AArch64 Linux CMake
on:
push:
@ -9,7 +9,7 @@ on:
jobs:
# Building using the github runner environement directly.
aarch64:
make:
runs-on: ubuntu-latest
strategy:
matrix:
@ -23,6 +23,6 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Build
run: make --directory=ci ${TARGET}_build
run: make --directory=cmake/ci ${TARGET}_build
- name: Test
run: make --directory=ci ${TARGET}_test
run: make --directory=cmake/ci ${TARGET}_test

View File

@ -1,4 +1,4 @@
name: amd64 FreeBSD
name: amd64 FreeBSD CMake
on:
push:
@ -10,7 +10,7 @@ on:
jobs:
# Only MacOS hosted runner provides virtualisation with vagrant/virtualbox installed.
# see: https://github.com/actions/virtual-environments/tree/main/images/macos
freebsd:
make:
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
@ -19,4 +19,4 @@ jobs:
- name: VirtualBox version
run: virtualbox -h
- name: Build
run: cd ci/vagrant/freebsd && vagrant up
run: cd cmake/ci/vagrant/freebsd && vagrant up

View File

@ -1,31 +0,0 @@
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

View File

@ -1,4 +1,4 @@
name: amd64 Bazel Linux
name: amd64 Linux Bazel
on:
push:

31
.github/workflows/amd64_linux_cmake.yml vendored Normal file
View File

@ -0,0 +1,31 @@
name: amd64 Linux CMake
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=cmake/ci amd64_env
- name: Devel
run: make --directory=cmake/ci amd64_devel
- name: Build
run: make --directory=cmake/ci amd64_build
- name: Test
run: make --directory=cmake/ci amd64_test
- name: Install Env
run: make --directory=cmake/ci amd64_install_env
- name: Install Devel
run: make --directory=cmake/ci amd64_install_devel
- name: Install Build
run: make --directory=cmake/ci amd64_install_build
- name: Install Test
run: make --directory=cmake/ci amd64_install_test

View File

@ -1,4 +1,4 @@
name: amd64 macOS
name: amd64 MacOS CMake
on:
push:

View File

@ -1,4 +1,4 @@
name: amd64 Windows
name: amd64 Windows CMake
on:
push:

View File

@ -1,4 +1,4 @@
name: arm Linux
name: ARM Linux CMake
on:
push:
@ -9,7 +9,7 @@ on:
jobs:
# Building using the github runner environement directly.
arm:
make:
runs-on: ubuntu-latest
strategy:
matrix:
@ -26,6 +26,6 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Build
run: make --directory=ci ${TARGET}_build
run: make --directory=cmake/ci ${TARGET}_build
- name: Test
run: make --directory=ci ${TARGET}_test
run: make --directory=cmake/ci ${TARGET}_test

View File

@ -1,4 +1,4 @@
name: mips Linux
name: MIPS Linux CMake
on:
push:
@ -9,7 +9,7 @@ on:
jobs:
# Building using the github runner environement directly.
mips:
make:
runs-on: ubuntu-latest
strategy:
matrix:
@ -25,6 +25,6 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Build
run: make --directory=ci ${TARGET}_build
run: make --directory=cmake/ci ${TARGET}_build
- name: Test
run: make --directory=ci ${TARGET}_test
run: make --directory=cmake/ci ${TARGET}_test

View File

@ -113,7 +113,7 @@ $(targets_amd64): amd64_%: docker/amd64/Dockerfile
--tag ${IMAGE}:amd64_$* \
--target=$* \
-f $< \
..
../..
#$(info Create targets: save_amd64 $(addprefix save_amd64_, $(STAGES)) (debug).)
save_targets_amd64 = $(addprefix save_amd64_, $(STAGES))
@ -160,7 +160,7 @@ $$(targets_toolchain_$1): %_$1: docker/toolchain/Dockerfile
--build-arg TARGET=$$* \
--target=$1 \
-f $$< \
..
../..
#$$(info Create targets: save_toolchain_$1 $(addprefix save_, $(addsuffix _$1, $(TOOLCHAIN_TARGETS))) (debug).)
save_targets_toolchain_$1 = $(addprefix save_, $(addsuffix _$1, $(TOOLCHAIN_TARGETS)))

View File

@ -7,20 +7,20 @@
| Windows | [![][img_4a]][lnk_4a] | ![][img_na] | ![][img_na] | ![][img_na] |
[img_na]: https://img.shields.io/badge/build-N%2FA-lightgrey
[lnk_1a]: https://github.com/google/cpu_features/actions/workflows/amd64_FreeBSD.yml
[img_1a]: https://img.shields.io/github/workflow/status/google/cpu_features/amd64%20FreeBSD/main
[lnk_2a]: https://github.com/google/cpu_features/actions/workflows/amd64_Linux.yml
[img_2a]: https://img.shields.io/github/workflow/status/google/cpu_features/amd64%20Linux/main
[lnk_3a]: https://github.com/google/cpu_features/actions/workflows/amd64_macOS.yml
[img_3a]: https://img.shields.io/github/workflow/status/google/cpu_features/amd64%20macOS/main
[lnk_4a]: https://github.com/google/cpu_features/actions/workflows/amd64_Windows.yml
[img_4a]: https://img.shields.io/github/workflow/status/google/cpu_features/amd64%20Windows/main
[lnk_2b]: https://github.com/google/cpu_features/actions/workflows/aarch64_Linux.yml
[img_2b]: https://img.shields.io/github/workflow/status/google/cpu_features/aarch64%20Linux/main
[lnk_2c]: https://github.com/google/cpu_features/actions/workflows/arm_Linux.yml
[img_2c]: https://img.shields.io/github/workflow/status/google/cpu_features/arm%20Linux/main
[lnk_2d]: https://github.com/google/cpu_features/actions/workflows/mips_Linux.yml
[img_2d]: https://img.shields.io/github/workflow/status/google/cpu_features/mips%20Linux/main
[lnk_1a]: https://github.com/google/cpu_features/actions/workflows/amd64_freebsd_cmake.yml
[img_1a]: https://img.shields.io/github/workflow/status/google/cpu_features/amd64%20FreeBSD%20CMake/main
[lnk_2a]: https://github.com/google/cpu_features/actions/workflows/amd64_linux_cmake.yml
[img_2a]: https://img.shields.io/github/workflow/status/google/cpu_features/amd64%20Linux%20CMake/main
[lnk_3a]: https://github.com/google/cpu_features/actions/workflows/amd64_macos_cmake.yml
[img_3a]: https://img.shields.io/github/workflow/status/google/cpu_features/amd64%20MacOS%20CMake/main
[lnk_4a]: https://github.com/google/cpu_features/actions/workflows/amd64_windows_cmake.yml
[img_4a]: https://img.shields.io/github/workflow/status/google/cpu_features/amd64%20Windows%20CMake/main
[lnk_2b]: https://github.com/google/cpu_features/actions/workflows/aarch64_linux_cmake.yml
[img_2b]: https://img.shields.io/github/workflow/status/google/cpu_features/AArch64%20Linux%20CMake/main
[lnk_2c]: https://github.com/google/cpu_features/actions/workflows/arm_linux_cmake.yml
[img_2c]: https://img.shields.io/github/workflow/status/google/cpu_features/ARM%20Linux%20CMake/main
[lnk_2d]: https://github.com/google/cpu_features/actions/workflows/mips_linux_cmake.yml
[img_2d]: https://img.shields.io/github/workflow/status/google/cpu_features/MIPS%20Linux%20CMake/main
## Makefile/Docker testing
To test the build on various distro, we are using docker containers and a Makefile for orchestration.

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

@ -38,7 +38,7 @@ COPY --from=build /usr/local /usr/local/
FROM install_env AS install_devel
WORKDIR /home/sample
COPY ci/sample .
COPY cmake/ci/sample .
FROM install_devel AS install_build
RUN cmake -S. -Bbuild

View File

@ -49,11 +49,11 @@ Vagrant.configure("2") do |config|
#config.vm.synced_folder "../../..", "/home/vagrant/project"
config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", disabled: true
config.vm.provision "file", source: "../../../CMakeLists.txt", destination: "$HOME/project/"
config.vm.provision "file", source: "../../../cmake", destination: "$HOME/project/"
config.vm.provision "file", source: "../../../include", destination: "$HOME/project/"
config.vm.provision "file", source: "../../../src", destination: "$HOME/project/"
config.vm.provision "file", source: "../../../test", destination: "$HOME/project/"
config.vm.provision "file", source: "../../../../CMakeLists.txt", destination: "$HOME/project/"
config.vm.provision "file", source: "../../../../cmake", destination: "$HOME/project/"
config.vm.provision "file", source: "../../../../include", destination: "$HOME/project/"
config.vm.provision "file", source: "../../../../src", destination: "$HOME/project/"
config.vm.provision "file", source: "../../../../test", destination: "$HOME/project/"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.

View File

@ -22,36 +22,6 @@ enum Os
Windows
}
string getWorkflowName(Cpu cpu)
{
final switch (cpu)
{
case Cpu.amd64:
return "amd64";
case Cpu.AArch64:
return "aarch64";
case Cpu.ARM:
return "arm";
case Cpu.MIPS:
return "mips";
}
}
string getWorkflowName(Os os)
{
final switch (os)
{
case Os.FreeBSD:
return "FreeBSD";
case Os.Linux:
return "Linux";
case Os.MacOS:
return "macOS";
case Os.Windows:
return "Windows";
}
}
struct Configuration
{
const:
@ -130,10 +100,13 @@ void main()
.map!(t => Configuration(t[0], t[1]))
.filter!(conf => !conf.disabled)
.each!((conf) {
const cpu_name = getWorkflowName(conf.cpu);
const os_name = getWorkflowName(conf.os);
writefln("%s: https://github.com/google/cpu_features/actions/workflows/%s_%s.yml", conf.link_ref, cpu_name, os_name);
writefln("%s: https://img.shields.io/github/workflow/status/google/cpu_features/%s%%20%s/main", conf
.image_ref, cpu_name, os_name);
import std.uni : toLower;
import std.uri : encode;
const filename = toLower(format("%s_%s_%s.yml", conf.cpu, conf.os, "cmake"));
writefln("%s: https://github.com/google/cpu_features/actions/workflows/%s", conf.link_ref, filename);
const worflow_name = encode(format("%s %s %s", conf.cpu, conf.os, "CMake"));
writefln("%s: https://img.shields.io/github/workflow/status/google/cpu_features/%s/main", conf.image_ref, worflow_name);
});
}