Move CI to GitHub Actions

A few highlights relative to our existing CI:

- Add a FreeBSD 12.2 and 13.0 runner so we have some FreeBSD CI.
- Windows builds use msbuild with the Visual-Studio-provided clang toolchain to test clang
 - The matrix builds describe the axes of the matrix, not all points.
 - The Arm builds now cross-compile with a native clang and run the tests with qemu, rather than running the compiler, linker, and ctest all with qemu.
 
This also includes a fix for one of the tests that was doing `static_cast<unsigned int>(1) << 36`, which is undefined behaviour and was sometimes causing qemu to hang.  There is now an assert to catch this in the future.
This commit is contained in:
David Chisnall
2021-08-03 17:10:56 +01:00
committed by GitHub
parent 704bc423cc
commit 0007a53ef9
12 changed files with 225 additions and 421 deletions

View File

@@ -48,6 +48,7 @@ namespace snmalloc
constexpr T one_at_bit(S shift)
{
static_assert(std::is_integral_v<T>, "Type must be integral");
SNMALLOC_ASSERT(sizeof(T) * 8 > static_cast<size_t>(shift));
return (static_cast<T>(1)) << shift;
}

View File

@@ -24,8 +24,9 @@ int main(int argc, char** argv)
setup();
constexpr int bits_to_test = bits::is64() ? 36 : 31;
T value = 0;
for (uintptr_t ptr = 0; ptr < bits::one_at_bit(36);
for (uintptr_t ptr = 0; ptr < bits::one_at_bit(bits_to_test);
ptr += bits::one_at_bit(GRANULARITY_BITS + 3))
{
pagemap_test.set(ptr, value);
@@ -38,7 +39,7 @@ int main(int argc, char** argv)
std::cout << std::endl;
value = 0;
for (uintptr_t ptr = 0; ptr < bits::one_at_bit(36);
for (uintptr_t ptr = 0; ptr < bits::one_at_bit(bits_to_test);
ptr += bits::one_at_bit(GRANULARITY_BITS + 3))
{
T result = pagemap_test.get(ptr);