add additional versions to test #199
Workflow file for this run
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: Run Tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: read | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
version: | |
- constraint: ~4.5.0 | |
config: 4 | |
- constraint: ~4.6.0 | |
config: 4 | |
- constraint: ~4.7.0 | |
config: 4 | |
- constraint: ~5.0.0 | |
config: 5 | |
- constraint: ~5.1.0 | |
config: 5 | |
- constraint: ~5.2.0 | |
config: 5.2 | |
- constraint: ~5.3.0 | |
config: 5.3 | |
- constraint: ~5.4.0 | |
config: 5.4 | |
env: | |
CRAFT_APP_ID: pest | |
CRAFT_ENVIRONMENT: dev | |
CRAFT_SECURITY_KEY: asdy8f7tgaysdfas987gduyvfas87dfghui | |
CRAFT_DB_DRIVER: mysql | |
CRAFT_DB_SERVER: 127.0.0.1 | |
CRAFT_DB_PORT: 3306 | |
CRAFT_DB_DATABASE: pest | |
CRAFT_DB_USER: root | |
CRAFT_DB_PASSWORD: root | |
CRAFT_DB_TABLE_PREFIX: craft_ | |
CRAFT_TEMPLATES_PATH: ./tests/templates | |
CRAFT_OMIT_SCRIPT_NAME_IN_URLS: true | |
CRAFT_DEV_MODE: true | |
DEV_MODE: true | |
CRAFT_EXE_PATH: ./src/bin/craft | |
PRIMARY_SITE_URL: http://localhost:8080 | |
services: | |
mysql: | |
image: mysql:8 | |
env: | |
MYSQL_ROOT_PASSWORD: root | |
MYSQL_DATABASE: pest | |
ports: | |
- 3306:3306 | |
#options: >- | |
# --health-cmd "mysqladmin ping --silent" | |
# --health-interval 10s | |
# --health-timeout 5s | |
# --health-retries 5 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.3' | |
- name: Validate composer.json and composer.lock | |
run: composer validate --strict | |
- name: Cache Composer packages | |
id: composer-cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
composer.lock | |
vendor | |
key: ${{ runner.os }}-craft-${{ matrix.version.constraint }}-vendor-${{ hashFiles('composer.json') }} | |
- name: Install dependencies | |
run: | | |
composer require "craftcms/cms:${{ matrix.version.constraint }}" --prefer-dist --no-progress | |
./bin/post-clone.sh | |
- name: Copy config files | |
run: | | |
mkdir -p ./storage | |
cp -r ./stubs/config/app.php ./config/app.php | |
cp -r ./stubs/config/general.php ./config/general.php | |
cp -r ./stubs/config/project-${{ matrix.version.config }}/ ./config/project/ | |
- name: Wait for MySQL | |
run: until mysqladmin ping -h 127.0.0.1 -u root -proot; do sleep 1; done | |
- name: Install Craft | |
run: php craft install --interactive=0 --username=admin [email protected] --password=secret --siteName=Pest --siteUrl=http://localhost:8080 --language=en-US | |
- name: Run PHPStan | |
run: ./vendor/bin/phpstan analyse src | |
- name: Run pint | |
run: ./vendor/bin/pint --test -vvv src/ | |
if: always() | |
- name: Run test suite | |
run: ./vendor/bin/pest --compact -vvv | |
if: always() |