mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-27 09:49:22 +02:00
Add Cypress workflow
This commit is contained in:
parent
269ae323e0
commit
2b739c2b40
68
.github/workflows/cypress.yml
vendored
Normal file
68
.github/workflows/cypress.yml
vendored
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
name: Cypress Test
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches: [develop]
|
||||||
|
push:
|
||||||
|
branches: [develop]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
cypress:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
services:
|
||||||
|
mysql:
|
||||||
|
image: mysql:latest
|
||||||
|
env:
|
||||||
|
MYSQL_ALLOW_EMPTY_PASSWORD: false
|
||||||
|
MYSQL_ROOT_PASSWORD: password
|
||||||
|
MYSQL_DATABASE: myaac-tfs-latest
|
||||||
|
ports:
|
||||||
|
- 3306/tcp
|
||||||
|
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
php-versions: [ '7.4', '8.0', '8.1' ]
|
||||||
|
steps:
|
||||||
|
- name: Checkout MyAAC
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Checkout TFS
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
repository: otland/forgottenserver
|
||||||
|
|
||||||
|
- run: ls -lha
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extensions: mbstring, dom, fileinfo, mysql, json, xml, pdo, pdo_mysql
|
||||||
|
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composer-cache
|
||||||
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composer-cache.outputs.dir }}
|
||||||
|
# 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-
|
||||||
|
|
||||||
|
- name: Install Composer dependencies
|
||||||
|
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
|
||||||
|
- name: Cypress Run
|
||||||
|
uses: cypress-io/github-action@v5
|
||||||
|
env:
|
||||||
|
URL: localhost
|
||||||
|
SERVER_PATH: otland-forgottenserver
|
||||||
|
|
||||||
|
- name: Save screenshots
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
name: cypress-screenshots
|
||||||
|
path: cypress/screenshots
|
Loading…
x
Reference in New Issue
Block a user