Skip to content

Commit

Permalink
Cypress test on canary + tfs-master
Browse files Browse the repository at this point in the history
  • Loading branch information
slawkens committed Feb 17, 2024
1 parent 9f3231f commit a59f0e9
Showing 1 changed file with 27 additions and 9 deletions.
36 changes: 27 additions & 9 deletions .github/workflows/cypress.yml
Expand Up @@ -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
Expand All @@ -38,41 +39,58 @@ 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
with:
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
with:
find: 'mysqlPass = ""'
replace: 'mysqlPass = "root"'
regex: false
include: 'tfs/config.lua'
include: 'ots/config.lua'

- name: Replace mysqlDatabase
uses: jacobtomlinson/gha-find-replace@v2
with:
find: 'mysqlDatabase = "forgottenserver"'
replace: 'mysqlDatabase = "myaac"'
regex: false
include: 'tfs/config.lua'
include: 'ots/config.lua'

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a59f0e9

Please sign in to comment.