Skip to content

✨ Support Windows using IOCP #3

✨ Support Windows using IOCP

✨ Support Windows using IOCP #3

name: Compiler Compatibility CI
on:
push:
branches: [master]
pull_request:
jobs:
build:
strategy:
fail-fast: false
matrix:
compiler:
# GCC 13 on MacOS seems to be generally broken (https://github.com/actions/runner-images/issues/9997) and therefore disabled
- { tag: "ubuntu-2204_clang-13", name: "Ubuntu 22.04 Clang 13", cxx: "/usr/bin/clang++-13", cc: "/usr/bin/clang-13", runs-on: "ubuntu-22.04" }
- { tag: "ubuntu-2204_clang-14", name: "Ubuntu 22.04 Clang 14", cxx: "/usr/bin/clang++-14", cc: "/usr/bin/clang-14", runs-on: "ubuntu-22.04" }
- { tag: "ubuntu-2204_clang-15", name: "Ubuntu 22.04 Clang 15", cxx: "/usr/bin/clang++-15", cc: "/usr/bin/clang-15", runs-on: "ubuntu-22.04" }
- { tag: "ubuntu-2204_gcc-10", name: "Ubuntu 22.04 G++ 10", cxx: "/usr/bin/g++-10", cc: "/usr/bin/gcc-10", runs-on: "ubuntu-22.04" }
- { tag: "ubuntu-2204_gcc-11", name: "Ubuntu 22.04 G++ 11", cxx: "/usr/bin/g++-11", cc: "/usr/bin/gcc-11", runs-on: "ubuntu-22.04" }
- { tag: "ubuntu-2004_clang-12", name: "Ubuntu 20.04 Clang 12", cxx: "/usr/bin/clang++-12", cc: "/usr/bin/clang-12", runs-on: "ubuntu-20.04" }
- { tag: "ubuntu-2004_clang-11", name: "Ubuntu 20.04 Clang 11", cxx: "/usr/bin/clang++-11", cc: "/usr/bin/clang-11", runs-on: "ubuntu-20.04" }
- { tag: "ubuntu-2004_clang-10", name: "Ubuntu 20.04 Clang 10", cxx: "/usr/bin/clang++-10", cc: "/usr/bin/clang-10", runs-on: "ubuntu-20.04" }
- { tag: "ubuntu-2004_gcc-10", name: "Ubuntu 20.04 G++ 10", cxx: "/usr/bin/g++-10", cc: "/usr/bin/gcc-10", runs-on: "ubuntu-20.04" }
- { tag: "windows-2022_msvc17", name: "Windows Server 2022 MSVC 17", cxx: "", cc: "", runs-on: "windows-2022" }
- { tag: "windows-2019_msvc16", name: "Windows Server 2019 MSVC 16", cxx: "", cc: "", runs-on: "windows-2019" }
- { tag: "macos-12_gcc-12", name: "MacOS 12 G++ 12", cxx: "g++-12", cc: "gcc-12", runs-on: "macos-12" }
#- { tag: "macos-12_gcc-13", name: "MacOS 12 G++ 13", cxx: "g++-13", cc: "gcc-13", runs-on: "macos-12" }
- { tag: "macos-12_gcc-14", name: "MacOS 12 G++ 14", cxx: "g++-14", cc: "gcc-14", runs-on: "macos-12" }
- { tag: "macos-12_clang-15", name: "MacOS 12 Clang 15", cxx: "/usr/local/opt/llvm@15/bin/clang++", cc: "/usr/local/opt/llvm@15/bin/clang", runs-on: "macos-12" }
- { tag: "macos-13_gcc-12", name: "MacOS 13 G++ 12", cxx: "g++-12", cc: "gcc-12", runs-on: "macos-13" }
#- { tag: "macos-13_gcc-13", name: "MacOS 13 G++ 13", cxx: "g++-13", cc: "gcc-13", runs-on: "macos-13" }
- { tag: "macos-13_gcc-14", name: "MacOS 13 G++ 14", cxx: "g++-14", cc: "gcc-14", runs-on: "macos-13" }
- { tag: "macos-13_clang-15", name: "MacOS 13 Clang 15", cxx: "/usr/local/opt/llvm@15/bin/clang++", cc: "/usr/local/opt/llvm@15/bin/clang", runs-on: "macos-13" }
- { tag: "macos-14_gcc-12", name: "MacOS 14 G++ 12", cxx: "g++-12", cc: "gcc-12", runs-on: "macos-14" }
#- { tag: "macos-14_gcc-13", name: "MacOS 14 G++ 13", cxx: "g++-13", cc: "gcc-13", runs-on: "macos-14" }
- { tag: "macos-14_gcc-14", name: "MacOS 14 G++ 14", cxx: "g++-14", cc: "gcc-14", runs-on: "macos-14" }
- { tag: "macos-14_clang-15", name: "MacOS 14 Clang 15", cxx: "/opt/homebrew/Cellar/llvm@15/15.0.7/bin/clang++", cc: "/opt/homebrew/Cellar/llvm@15/15.0.7/bin/clang", runs-on: "macos-14" }
runs-on: ${{ matrix.compiler.runs-on }}
name: Compiler ${{ matrix.compiler.name }}
env:
CXX: ${{ matrix.compiler.cxx }}
CC: ${{ matrix.compiler.cc }}
outputs:
# Because github wants us to suffer we need to list out every output instead of using a matrix statement or some kind of dynamic setting
ubuntu-2204_clang-13: ${{ steps.status.outputs.ubuntu-2204_clang-13 }}
ubuntu-2204_clang-14: ${{ steps.status.outputs.ubuntu-2204_clang-14 }}
ubuntu-2204_clang-15: ${{ steps.status.outputs.ubuntu-2204_clang-15 }}
ubuntu-2204_gcc-10: ${{ steps.status.outputs.ubuntu-2204_gcc-10 }}
ubuntu-2204_gcc-11: ${{ steps.status.outputs.ubuntu-2204_gcc-11 }}
ubuntu-2004_clang-12: ${{ steps.status.outputs.ubuntu-2004_clang-12 }}
ubuntu-2004_clang-11: ${{ steps.status.outputs.ubuntu-2004_clang-11 }}
ubuntu-2004_clang-10: ${{ steps.status.outputs.ubuntu-2004_clang-10 }}
ubuntu-2004_gcc-10: ${{ steps.status.outputs.ubuntu-2004_gcc-10 }}
windows-2022_msvc17: ${{ steps.status.outputs.windows-2022_msvc17 }}
windows-2019_msvc16: ${{ steps.status.outputs.windows-2019_msvc16 }}
macos-12_gcc-12: ${{ steps.status.outputs.macos-12_gcc-12 }}
macos-12_gcc-13: ${{ steps.status.outputs.macos-12_gcc-13 }}
macos-12_gcc-14: ${{ steps.status.outputs.macos-12_gcc-14 }}
macos-12_clang-15: ${{ steps.status.outputs.macos-12_clang-15 }}
macos-13_gcc-12: ${{ steps.status.outputs.macos-13_gcc-12 }}
macos-13_gcc-13: ${{ steps.status.outputs.macos-13_gcc-13 }}
macos-13_gcc-14: ${{ steps.status.outputs.macos-13_gcc-14 }}
macos-13_clang-15: ${{ steps.status.outputs.macos-13_clang-15 }}
macos-14_gcc-12: ${{ steps.status.outputs.macos-14_gcc-12 }}
macos-14_gcc-13: ${{ steps.status.outputs.macos-14_gcc-13 }}
macos-14_gcc-14: ${{ steps.status.outputs.macos-14_gcc-14 }}
macos-14_clang-15: ${{ steps.status.outputs.macos-14_clang-15 }}
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set LDFLAGS=-Wl,-ld_classic
if: contains(matrix.compiler.tag, 'macos-13') || contains(matrix.compiler.tag, 'macos-14')
run: echo "LDFLAGS=-Wl,-ld_classic" >> $GITHUB_ENV
# Ubuntu 22.04 container has libstdc++13 installed which is incompatible with clang < 15 in C++20
- name: Uninstall libstdc++-13-dev
if: (matrix.compiler.tag == 'ubuntu-2204_clang-14') || (matrix.compiler.tag == 'ubuntu-2204_clang-13')
run: |
sudo apt autoremove libstdc++-13-dev gcc-13 libgcc-13-dev
sudo apt install libstdc++-12-dev gcc-12 libgcc-12-dev
- name: Install liburing
# Ubuntu 22.04 can just pull liburing from apt
if: contains(matrix.compiler.tag, 'ubuntu-2204')
run: sudo apt install liburing-dev
- name: Install liburing
# Ubuntu 20.04 does not have liburing in apt, pull in deb files from 22.04 instead
if: contains(matrix.compiler.tag, 'ubuntu-2004')
run: |
wget -O /tmp/liburing2_2.1-2build1_amd64.deb http://mirrors.kernel.org/ubuntu/pool/main/libu/liburing/liburing2_2.1-2build1_amd64.deb
wget -O /tmp/liburing-dev_2.1-2build1_amd64.deb http://mirrors.kernel.org/ubuntu/pool/main/libu/liburing/liburing-dev_2.1-2build1_amd64.deb
sudo dpkg -i /tmp/liburing-dev_2.1-2build1_amd64.deb /tmp/liburing2_2.1-2build1_amd64.deb
- name: Configure
if: contains(matrix.compiler.tag, 'ubuntu')
run: cmake -S. -Bbuild -DASYNCPP_BUILD_TEST=ON -DASYNCPP_WITH_ASAN=ON -DASYNCPP_WITH_TSAN=OFF
- name: Configure
if: contains(matrix.compiler.tag, 'ubuntu') != true
run: cmake -S. -Bbuild -DASYNCPP_BUILD_TEST=ON -DASYNCPP_WITH_ASAN=OFF -DASYNCPP_WITH_TSAN=OFF
- name: Build
run: cmake --build build --config Debug
- name: Test
working-directory: ${{ github.workspace }}/build
if: contains(matrix.compiler.tag, 'windows') != true
run: ./asyncpp_io-test
- name: Test
if: contains(matrix.compiler.tag, 'windows')
working-directory: ${{ github.workspace }}/build
run: Debug/asyncpp_io-test.exe
- name: Update Result
id: status
if: ${{ always() }}
run: echo "${{ matrix.compiler.tag }}=${{ job.status }}" >> $GITHUB_OUTPUT
badge-upload:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && always() }}
needs: [build]
runs-on: ubuntu-20.04
name: Publish badges
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Publish Badges
uses: ./.github/actions/badge
with:
category: compiler
badges: ${{ toJson(needs.build.outputs) }}