From 97b6f182c8ab7c46850c1e14cba7fb57f3e87ceb Mon Sep 17 00:00:00 2001 From: Joni Orponen Date: Mon, 2 May 2022 13:54:50 +0200 Subject: [PATCH] Add a unit test CI run. --- .github/dependabot.yaml | 6 ++ .github/workflows/push-test-debian.yaml | 61 +++++++++++++++++ .github/workflows/push-test-fedora.yaml | 56 ++++++++++++++++ .../workflows/push-test-opensuse-leap.yaml | 66 +++++++++++++++++++ .github/workflows/push-test-ubuntu.yaml | 58 ++++++++++++++++ 5 files changed, 247 insertions(+) create mode 100644 .github/dependabot.yaml create mode 100644 .github/workflows/push-test-debian.yaml create mode 100644 .github/workflows/push-test-fedora.yaml create mode 100644 .github/workflows/push-test-opensuse-leap.yaml create mode 100644 .github/workflows/push-test-ubuntu.yaml diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 000000000..d81952297 --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/.github/workflows" + schedule: + interval: "monthly" diff --git a/.github/workflows/push-test-debian.yaml b/.github/workflows/push-test-debian.yaml new file mode 100644 index 000000000..1ebd7ed21 --- /dev/null +++ b/.github/workflows/push-test-debian.yaml @@ -0,0 +1,61 @@ +name: Debian +on: push + +jobs: + test: + name: Unit Tests Debian + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + debian: + # Bullseye is the oldest Debian with a new enough glm + - "bullseye" # 11 + - "bookworm" # 12 + - "trixie" # 13 + compiler: + - g++ + - clang + container: debian:${{ matrix.debian }}-slim + steps: + - name: Install Dependencies + env: + DEBIAN_FRONTEND: noninteractive + run: | + apt-get update -qq + apt-get install \ + -y \ + -qq \ + --no-install-recommends \ + --no-install-suggests \ + ca-certificates \ + git \ + ${{ matrix.compiler }} \ + libboost-dev \ + libboost-filesystem-dev \ + libboost-locale-dev \ + libboost-regex-dev \ + libboost-system-dev \ + libcairo2-dev \ + libglew-dev \ + libglm-dev \ + libsdl2-dev \ + libsdl2-image-dev \ + libsdl2-mixer-dev \ + libsdl2-ttf-dev \ + libvorbis-dev \ + make + + - name: Checkout Anura + uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0 + with: + submodules: true + + - name: Build Anura + env: + CXX: ${{ matrix.compiler }} + # Number of cores * 3 + run: make -j "$(($(getconf _NPROCESSORS_ONLN) * 3))" + + - name: Run Unit Tests + run: ./anura --tests diff --git a/.github/workflows/push-test-fedora.yaml b/.github/workflows/push-test-fedora.yaml new file mode 100644 index 000000000..5e7070e89 --- /dev/null +++ b/.github/workflows/push-test-fedora.yaml @@ -0,0 +1,56 @@ +name: Fedora +on: push + +jobs: + test: + name: Unit Tests Fedora + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + fedora: + # 32 is the oldest Fedora with a new enough glm + - "32" + - "33" + - "34" + - "35" + - "36" + - "37" + - "38" + - "39" + compiler: + - g++ + - clang + container: fedora:${{ matrix.fedora }} + steps: + - name: Install Dependencies + run: | + dnf -y update + dnf -y install \ + git \ + ${{ matrix.compiler }} \ + make \ + which \ + SDL2-devel \ + boost-devel \ + glm-devel \ + glew-devel \ + cairo-devel \ + SDL2_ttf-devel \ + SDL2_image-devel \ + SDL2_mixer-devel \ + libvorbis-devel + + - name: Checkout Anura + uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0 + with: + submodules: true + + - name: Build Anura + env: + CXX: ${{ matrix.compiler }} + # Number of cores * 3 + run: make -j "$(($(getconf _NPROCESSORS_ONLN) * 3))" + + - name: Run Unit Tests + run: ./anura --tests diff --git a/.github/workflows/push-test-opensuse-leap.yaml b/.github/workflows/push-test-opensuse-leap.yaml new file mode 100644 index 000000000..b088220da --- /dev/null +++ b/.github/workflows/push-test-opensuse-leap.yaml @@ -0,0 +1,66 @@ +name: openSUSE Leap +on: push + +jobs: + test: + name: Unit Tests openSUSE Leap + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + suse: + # 15.3 is the oldest openSUSE Leap with a new enough glm + - "15.3" + - "15.4" + - "15.5" + compiler: + - g++ + - clang + container: opensuse/leap:${{ matrix.suse }} + steps: + - name: Resolve Compiler Package Name + run: | + if [[ ${{ matrix.compiler }} == g++ ]] + then + echo compiler=gcc-c++ >> "$GITHUB_ENV" + else + echo compiler=clang >> "$GITHUB_ENV" + fi + + - name: Install Dependencies + run: | + zypper --non-interactive update + zypper --non-interactive install \ + git \ + ${{ env.compiler }} \ + make \ + which \ + libSDL2-devel \ + glm-devel \ + glew-devel \ + boost-devel \ + libSDL2_image-devel \ + cairo-devel \ + libSDL2_ttf-devel \ + libSDL2_mixer-devel \ + libvorbis-devel \ + libicu-devel \ + libboost_system*6*devel \ + libboost_locale*6*devel \ + libboost_regex*6*devel \ + libboost_filesystem*6*devel \ + libboost_thread*6*devel + + - name: Checkout Anura + uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0 + with: + submodules: true + + - name: Build Anura + env: + CXX: ${{ matrix.compiler }} + # Number of cores * 3 + run: make -j "$(($(getconf _NPROCESSORS_ONLN) * 3))" + + - name: Run Unit Tests + run: ./anura --tests diff --git a/.github/workflows/push-test-ubuntu.yaml b/.github/workflows/push-test-ubuntu.yaml new file mode 100644 index 000000000..2caae795a --- /dev/null +++ b/.github/workflows/push-test-ubuntu.yaml @@ -0,0 +1,58 @@ +name: Ubuntu +on: push + +jobs: + test: + name: Unit Tests Ubuntu + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + ubuntu: + - "22.04" # LTS only for sanity + compiler: + - g++ + - clang + container: ubuntu:${{ matrix.ubuntu }} + steps: + - name: Install Dependencies + env: + DEBIAN_FRONTEND: noninteractive + run: | + apt-get update -qq + apt-get install \ + -y \ + -qq \ + --no-install-recommends \ + --no-install-suggests \ + ca-certificates \ + git \ + ${{ matrix.compiler }} \ + libboost-dev \ + libboost-filesystem-dev \ + libboost-locale-dev \ + libboost-regex-dev \ + libboost-system-dev \ + libcairo2-dev \ + libglew-dev \ + libglm-dev \ + libsdl2-dev \ + libsdl2-image-dev \ + libsdl2-mixer-dev \ + libsdl2-ttf-dev \ + libvorbis-dev \ + make + + - name: Checkout Anura + uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0 + with: + submodules: true + + - name: Build Anura + env: + CXX: ${{ matrix.compiler }} + # Number of cores * 3 + run: make -j "$(($(getconf _NPROCESSORS_ONLN) * 3))" + + - name: Run Unit Tests + run: ./anura --tests