Merge pull request #11499 from notbakaneko/feature/refactor-discussio… #12686
This file contains 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 | |
env: | |
APP_ENV: testing | |
APP_KEY: base64:q7U5qyAkedR1F6UhN0SQlUxBpAMDyfHy3NNFkqmiMqA= | |
APP_URL: http://localhost:8000 | |
DB_HOST: 127.0.0.1 | |
DUSK_WEBDRIVER_URL: http://127.0.0.1:9515 | |
ES_SOLO_SCORES_HOST: http://localhost:9200 | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NOTIFICATION_ENDPOINT: ws://localhost:2345 | |
OSU_INSTALL_DEV: 1 | |
OSU_USE_SYSTEM_COMPOSER: 1 | |
OSU_DB_CREATE: 1 | |
PAYMENT_SANDBOX: true | |
PASSPORT_PRIVATE_KEY: |+ | |
-----BEGIN PRIVATE KEY----- | |
MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQCmEdH3wybDftSh | |
DkAPHA/43mAelOj135qhqEWUvM3vz2ggVMT9WT9A+fZiFZzZc0K9GCzKlpnSRlb5 | |
xycwtoUCUL/vOxts2cpPu/OVTiyDrF8+4QtjuVAMTugFdcatUTuQXbxawbNGBazk | |
M3+BGd1nSAuNMwEY6od6kEE1OGS/ePkGctZxfh/WOmFeT9GtQLyMSab478wjPS4+ | |
vAyjgHHuBOYqZsFbu/WUURmAa6qTYGoZ7x21R00vP7fjnHahzezidDwAe6s9XX0N | |
ieh5fGypsgOQSpwiFXiENTObL8RSKhFsN4rWYv7JtGpOwF6uTf8ioj/9iQ2G2Wa0 | |
zegdzLaprKZxLBMA0XqQOG2lWzRujW8zvvjrWDo1WxAz5JvKzONcHU0o7vbgD07u | |
Fsi1QJCJ8sTFzq/GGqKA1jc+RehDbfg2iXm83V8ioutm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D/DRGWo01opIOIiRIioBqo4t | |
99jR6ABVhhLxpBcMBujilbGT4o8JaVRT5tc4Y7XLI+2w5nVyS+4J7p1Z/wgjuOcl | |
R1aUr+2PxLp0RZmRV+fIx44XcpBiS9bIv4YAujbx1KqwWQvBuleNPr10WY/7IRr5 | |
2rvfIu0tiZTvlg8GXSQCKfAxuL8qzRgmwBzzphS0s69fl3XLj00b6MPCyZPQaaZL | |
mUfX91MJeaRN7VfxdP9/wpL7ZQCte/5KlrhSOkeEJKLish98j+wJsWW+VSCsavG/ | |
H/EZAoIBAGfvtsP++9a6YP80lZ5uadP9WH3D74oMelbyaFRWVK4wqMqFqet1aSJJ | |
19S6fRlkpTm2RtmJhleOa+4pbNO1KQRd1ZGDl0m3UN+NNwS3TRGzOlXUPXnxcwRU | |
TemRmKnjEce6vC/Gh0E+5CdTjifNmce2MPyGgvGAV3GIgSAM2yIqKCjWo96eSThl | |
5QttXhvWxNP+RhLUkxpd9nEIilf4p0etUnjkTeHcDw67KjfS0YnJ9VGq1iCLRlGh | |
suKs9738LlFwEEDFD73iRY7o/Wz9wox7E0CuqfkAikwYHiGsI2n+bL7AXNj8k4GF | |
qkWREaw6Mt2MfHwSFoJooagIuAIHMGw= | |
-----END PRIVATE KEY----- | |
PASSPORT_PUBLIC_KEY: |+ | |
-----BEGIN PUBLIC KEY----- | |
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAphHR98Mmw37UoQ5ADxwP | |
+N5gHpTo9d+aoahFlLzN789oIFTE/Vk/QPn2YhWc2XNCvRgsypaZ0kZW+ccnMLaF | |
AlC/7zsbbNnKT7vzlU4sg6xfPuELY7lQDE7oBXXGrVE7kF28WsGzRgWs5DN/gRnd | |
Z0gLjTMBGOqHepBBNThkv3j5BnLWcX4f1jphXk/RrUC8jEmm+O/MIz0uPrwMo4Bx | |
7gTmKmbBW7v1lFEZgGuqk2BqGe8dtUdNLz+345x2oc3s4nQ8AHurPV19DYnoeXxs | |
qbIDkEqcIhV4hDUzmy/EUioRbDeK1mL+ybRqTsBerk3/IqI//YkNhtlmtM3oHcy2 | |
qaymcSwTANF6kDhtpVs0bo1vM77461g6NVsQM+SbyszjXB1NKO724A9O7hbItUCQ | |
ifLExc6vxhqigNY3PkXoQ234Nol5vN1fIqLrZqXfQqd8JsKmbL/OLArVZ5R+gxNP | |
eI/aegNuaIvvsK9zNlyMbOdQqIU7LTFGHZ5bHcSz3haftL+dI1NVn6jOXpBRMWWL | |
jyPrpFMb6yffQYTgLtFjJUET6SNasXiJJh90y1ySKwv+5M2J8qpFGynolz2XJq+V | |
guz1jhIlRmg6O+thTZc71fg0vcUjcLuPy2z7VNX4YcPpkmev68NPCWpCAqi0zjMy | |
HQZdh/ScL40oDGb6HRdKan0CAwEAAQ== | |
-----END PUBLIC KEY----- | |
REDIS_HOST: 127.0.0.1 | |
SHOPIFY_DOMAIN: notarealdomainortld | |
SHOPIFY_STOREFRONT_TOKEN: notreal | |
SLACK_ENDPOINT: https://myconan.net/null/ | |
jobs: | |
tests: | |
strategy: | |
matrix: | |
php: ['8.3'] | |
name: Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Services | |
run: 'docker compose up --quiet-pull --wait | |
beatmap-difficulty-lookup-cache | |
db | |
elasticsearch | |
notification-server | |
redis | |
score-indexer | |
' | |
- name: Setup node.js | |
uses: actions/setup-node@v4 | |
with: | |
cache: yarn | |
node-version: '20' | |
- name: Set php version | |
uses: shivammathur/setup-php@v2 | |
with: | |
extensions: redis, swoole | |
tools: composer:v2 | |
php-version: ${{ matrix.php }} | |
coverage: none | |
- name: Get composer cache directory | |
id: composercache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache composer | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.composercache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- run: ./build.sh | |
- name: Setup indices | |
run: | | |
php artisan es:create-search-blacklist | |
php artisan es:index-documents --no-interaction | |
php artisan es:index-wiki --create-only --no-interaction | |
- name: Generate docs | |
run: php artisan scribe:generate | |
- name: Run PHPUnit | |
run: ./bin/phpunit.sh | |
# 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: php artisan es:index-documents --no-interaction | |
- name: Run Dusk | |
run: ./bin/run_dusk.sh | |
- name: Run karma | |
run: yarn karma start --single-run --browsers ChromeHeadless | |
# 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: | | |
php artisan migrate:reset | tee rollback.log | |
grep -Fq 'no rolling back from this migration =)' rollback.log |