From a59f0e924490ede5320ae5739a1faeea5009e969 Mon Sep 17 00:00:00 2001 From: slawkens Date: Sat, 17 Feb 2024 07:55:51 +0100 Subject: [PATCH] Cypress test on canary + tfs-master --- .github/workflows/cypress.yml | 36 ++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index cc77f060..ec364828 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -23,6 +23,7 @@ jobs: fail-fast: false matrix: php-versions: [ '8.1', '8.2', '8.3' ] + ots: ['tfs-master', 'tfs-1.4', 'canary-3.1.2'] name: MyAAC on PHP ${{ matrix.php-versions }} steps: - name: 📌 MySQL Start & init & show db @@ -38,17 +39,34 @@ jobs: - name: Checkout TFS uses: actions/checkout@v4 + if: matrix.ots == 'tfs-1.4' with: repository: otland/forgottenserver ref: 1.4 - path: tfs + path: ots - - name: Import TFS Schema + - name: Checkout TFS + uses: actions/checkout@v4 + if: matrix.ots == 'tfs-master' + with: + repository: otland/forgottenserver + ref: master + path: ots + + - name: Checkout Canary + uses: actions/checkout@v4 + if: matrix.ots == 'canary-3.1.2' + with: + repository: opentibiabr/canary + ref: v3.1.2 + path: ots + + - name: Import OTS Schema run: | - mysql -uroot -proot myaac < tfs/schema.sql + mysql -uroot -proot myaac < ots/schema.sql - name: Rename config.lua - run: mv tfs/config.lua.dist tfs/config.lua + run: mv ots/config.lua.dist ots/config.lua - name: Replace mysqlUser uses: jacobtomlinson/gha-find-replace@v2 @@ -56,7 +74,7 @@ jobs: find: 'mysqlUser = "forgottenserver"' replace: 'mysqlUser = "root"' regex: false - include: 'tfs/config.lua' + include: 'ots/config.lua' - name: Replace mysqlPass uses: jacobtomlinson/gha-find-replace@v2 @@ -64,7 +82,7 @@ jobs: find: 'mysqlPass = ""' replace: 'mysqlPass = "root"' regex: false - include: 'tfs/config.lua' + include: 'ots/config.lua' - name: Replace mysqlDatabase uses: jacobtomlinson/gha-find-replace@v2 @@ -72,7 +90,7 @@ jobs: find: 'mysqlDatabase = "forgottenserver"' replace: 'mysqlDatabase = "myaac"' regex: false - include: 'tfs/config.lua' + include: 'ots/config.lua' - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -91,7 +109,7 @@ jobs: # Use composer.json for key, if composer.lock is not committed. key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} #key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- + restore-keys: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} - name: Install Composer dependencies run: composer install --no-progress --prefer-dist --optimize-autoloader @@ -103,7 +121,7 @@ jobs: uses: cypress-io/github-action@v6 env: CYPRESS_URL: http://localhost:8080 - CYPRESS_SERVER_PATH: /home/runner/work/myaac/myaac/tfs + CYPRESS_SERVER_PATH: /home/runner/work/myaac/myaac/ots - name: Save screenshots uses: actions/upload-artifact@v4