name: Run tests

on: [push]

jobs:
    build_and_run:
        name: Build and run tests
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4
            with:
                lfs: true

          - uses: actions/setup-java@v3
            with:
                distribution: 'zulu'
                java-version: '21'

          - name: Build && Run
            run: |
              deployer_url="https://raw.githubusercontent.com/Insality/defold-deployer/1/deployer.sh"
              curl -s ${deployer_url} | bash -s lbd --headless --settings ./test/test.ini

          - name: Upload coverage reports to Codecov
            uses: codecov/codecov-action@v4.0.1
            with:
              token: ${{ secrets.CODECOV_TOKEN }}
              slug: insality/druid
