name: test

on: [push, pull_request]

jobs:
  build:

    runs-on: ubuntu-latest
    timeout-minutes: 10
    strategy:
      matrix:
        ENGINE_IMAGE:
          - registry.gitlab.com/minetest/minetest/server:5.6.0
          - registry.gitlab.com/minetest/minetest/server:5.7.0
          - ghcr.io/minetest-hosting/minetest-docker:5.8.0
          - ghcr.io/minetest/minetest:5.9.0

    steps:
    - uses: actions/checkout@v4
      with:
        fetch-depth: 0
        submodules: recursive
    - name: test
      run: docker compose up --exit-code-from testserver
      env:
        ENGINE_IMAGE: ${{ matrix.ENGINE_IMAGE }}
