Skip to content

Unit Tests / Required / Static / Linux #107

Unit Tests / Required / Static / Linux

Unit Tests / Required / Static / Linux #107

name: Unit Tests / Required / Static / Linux
on:
pull_request:
merge_group:
jobs:
build:
name: Build and Test in Steam SDK
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
# XXX - This matrix needs to stay in sync with the test job below!
compiler:
# Only g++ builds actually work currently
- g++
build-type:
- Release
- Debug
steam-runtime:
# - scout v1 - Debian Stretch / 9 - has a glibc too old for Github Actions / Node 20
# - soldier v2 - Debian Buster / 10 - has a weird compiler and a weird ld, no idea what is up there
- sniper # v3 - Debian Bullseye / 11
# - medic v4 - Debian Bookworm / 12 - not in the container registry yet
# - ??? v5 - Debian Trixie / 13 - not in the container registry yet
container: registry.gitlab.steamos.cloud/steamrt/${{ matrix.steam-runtime }}/sdk
steps:
- name: Install Dependencies
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get -qq update
sudo apt-get -qq upgrade -y
sudo apt-get -qq install -y --no-install-recommends \
autoconf-archive
- name: Checkout Anura
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
submodules: true
- name: Ignore Filesystem Permissions for Git
run: git config --global --add safe.directory '*'
# Sets a cache up for vcpkg
- name: Install vcpkg
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
- name: Set ccache up
uses: hendrikmuhs/ccache-action@ed74d11c0b343532753ecead8a951bb09bb34bc9 # v1.2.14
with:
key: unit-tests-linux-static-steam-${{ matrix.build-type }}-${{ matrix.compiler }}-${{ matrix.steam-runtime }}
- name: Build Prep Anura
run: |
cmake . \
-D CMAKE_CXX_COMPILER="${{ matrix.compiler }}" \
-D CMAKE_BUILD_TYPE="${{ matrix.build-type }}" \
-D CMAKE_LINK_TYPE=Static
- name: Build Anura
run: |
# Compile with number of available hyperthreads
make -j "$(getconf _NPROCESSORS_ONLN)"
- name: Run Unit Tests
run: ./anura --tests
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: anura-static-binary-${{ matrix.build-type }}-${{ matrix.steam-runtime }}-${{ matrix.compiler }}-${{ github.sha }}
path: anura
if-no-files-found: error
test:
name: Test on Steam Platform
needs: build
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
# XXX - This matrix needs to stay in sync with the build job above!
compiler:
# Only g++ builds actually work currently
- g++
build-type:
- Release
- Debug
steam-runtime:
# - scout v1 - Debian Stretch / 9 - has a glibc too old for Github Actions / Node 20
# - soldier v2 - Debian Buster / 10 - has a weird compiler and a weird ld, no idea what is up there
- sniper # v3 - Debian Bullseye / 11
# - medic v4 - Debian Bookworm / 12 - not in the container registry yet
# - ??? v5 - Debian Trixie / 13 - not in the container registry yet
container: registry.gitlab.steamos.cloud/steamrt/${{ matrix.steam-runtime }}/platform
steps:
- name: Checkout Anura
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: anura-static-binary-${{ matrix.build-type }}-${{ matrix.steam-runtime }}-${{ matrix.compiler }}-${{ github.sha }}
- name: Run Unit Tests
run: |
chmod +x anura
./anura --tests