name: "libnbtplusplus: CI" on: workflow_dispatch: workflow_call: permissions: contents: read jobs: build: name: Build (${{ matrix.os }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] shared: [ON, OFF] steps: - name: Checkout uses: actions/checkout@v6 - name: Install zlib (Linux) if: runner.os == 'Linux' run: sudo apt-get update && sudo apt-get install -y zlib1g-dev cxxtest - name: Install zlib (macOS) if: runner.os == 'macOS' run: brew install zlib cxxtest - uses: ilammy/msvc-dev-cmd@v1 if: runner.os == 'Windows' - name: Configure if: runner.os != 'Windows' run: | cmake -S libnbtplusplus -B build \ -DCMAKE_BUILD_TYPE=Release \ -DNBT_BUILD_SHARED=${{ matrix.shared }} \ -DNBT_USE_ZLIB=ON \ -DNBT_BUILD_TESTS=ON - name: Configure (Windows) if: runner.os == 'Windows' run: | cmake -S libnbtplusplus -B build \ -DCMAKE_BUILD_TYPE=Release \ -DNBT_BUILD_SHARED=${{ matrix.shared }} \ -DNBT_USE_ZLIB=OFF \ -DNBT_BUILD_TESTS=OFF - name: Build run: cmake --build build --config Release -j2 - name: Test run: ctest --test-dir build -C Release --output-on-failure lint-reuse: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - name: REUSE Compliance Check uses: fsfe/reuse-action@v6