Attempt to type notification details #17130
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: [push, pull_request] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| tests: | |
| name: Tests | |
| runs-on: ubuntu-latest | |
| env: | |
| ASSETS_COMMAND: assets | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Create .env | |
| run: | | |
| cat > .env <<EOF | |
| APP_ENV=testing | |
| APP_URL=http://nginx | |
| PAYMENT_SANDBOX=true | |
| EOF | |
| - name: Create .env.testing | |
| run: | | |
| ln -s .env .env.testing | |
| - name: Create .env.dusk.local | |
| run: | | |
| ln -s .env .env.dusk.local | |
| - name: Get current date | |
| id: current-date | |
| run: echo "today=$(date '+%Y%m%d')" >> "$GITHUB_OUTPUT" | |
| - name: Cache ip2asn | |
| uses: actions/cache@v5 | |
| with: | |
| path: database/ip2asn/ | |
| key: ip2asn-${{ steps.current-date.outputs.today }} | |
| restore-keys: ip2asn- | |
| - name: Cache composer | |
| uses: actions/cache@v5 | |
| with: | |
| path: .docker/.cache/composer/files/ | |
| key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Spin up Docker dev environment | |
| run: ./bin/docker_dev.sh -d | |
| - name: Wait for migrations to be done | |
| run: docker compose logs -t -f migrator & docker compose wait migrator || true | |
| - name: Wait for assets building to be done | |
| run: docker compose logs -t -f assets & docker compose wait assets || true | |
| - name: Generate docs | |
| run: docker compose exec php /app/docker/development/entrypoint.sh artisan scribe:generate | |
| - name: Run PHPUnit | |
| run: docker compose exec php /app/docker/development/entrypoint.sh test phpunit | |
| # TODO: workaround things (beatmaps) being indexed during test above and not cleaned up. | |
| # This used to cause beatmap listing returning cursor with Long.MIN_VALUE for null timetamp | |
| # and errors out when trying to get the next page (es can't parse such value for timestamp) | |
| # but has since been fixed. | |
| # Something should still be done regarding es index between tests though. | |
| - name: Clean indexes | |
| run: docker compose exec php /app/docker/development/entrypoint.sh artisan es:index-documents --no-interaction | |
| - name: Run Dusk | |
| run: docker compose exec php /app/docker/development/entrypoint.sh artisan dusk | |
| - name: Run karma | |
| run: docker compose run --rm testjs | |
| # this only tests that the rollback functions are valid and doesn't check | |
| # if they actually do what they're expected to do. | |
| - name: Migration rollback test | |
| run: | | |
| docker compose exec php /app/docker/development/entrypoint.sh artisan migrate:reset | tee rollback.log | |
| grep -Fq 'no rolling back from this migration =)' rollback.log |