Skip to content

Commit

Permalink
Init GA workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
chalasr committed Dec 17, 2020
1 parent 7b1b832 commit 9975011
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 2 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: "Tests"

on:
pull_request:
push:

jobs:
php-74:
name: PHPUnit (PHP 7.4)
runs-on: ubuntu-latest

services:
mysql:
image: mysql:8.0
options: >-
--health-cmd "mysqladmin ping --silent"
-e MYSQL_ALLOW_EMPTY_PASSWORD=yes
-e MYSQL_DATABASE=claroline_test
ports:
- "3306:3306"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
with:
fetch-depth: 2

- name: "Install PHP 7.4"
uses: "shivammathur/setup-php@v2"
with:
php-version: "7.4"
extensions: pdo_mysql

- name: Determine composer cache directory
id: composer-cache
run: echo "::set-output name=directory::$(composer config cache-dir)"

- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.directory }}
key: composer-${{ hashFiles('**/composer.lock') }}
restore-keys: composer-

- name: "Install PHP dependencies with composer"
run: composer update --no-interaction

- name: "Set project parameters"
run: "php bin/configure --default"

- name: "Install Claroline platform"
run: php bin/console claroline:install --env=test -vvv

- name: "Run PHPUnit Tests"
run: SYMFONY_DEPRECATIONS_HELPER=weak vendor/bin/simple-phpunit --dont-report-useless-tests
2 changes: 1 addition & 1 deletion bin/configure
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

$params = [
['database_host', 'DB_HOST', 'localhost'],
['database_host', 'DB_HOST', '127.0.0.1'],
['database_name', 'DB_NAME', 'claroline'],
['database_user', 'DB_USER', 'root'],
['database_password', 'DB_PASSWORD', null],
Expand Down
2 changes: 1 addition & 1 deletion config/parameters.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ parameters:

database_version: 5.6
database_driver: pdo_mysql
database_host: localhost
database_host: 127.0.0.1
database_port: ~
database_name: claroline
database_user: root
Expand Down

0 comments on commit 9975011

Please # to comment.