@@ -24,11 +24,11 @@ jobs:
2424 run : vendor/bin/spiral-cs check src tests
2525 test :
2626 needs : lint
27- name : Test PHP ${{ matrix.php-versions }}
27+ name : Test PHP ${{ matrix.php-versions }} with Code Coverage
2828 runs-on : ubuntu-latest
2929 strategy :
3030 matrix :
31- php-versions : ['7.2', '7.3', '7.4']
31+ php-versions : ['7.2', '7.3', '7.4', '8.0' ]
3232 steps :
3333 - name : Checkout
3434 uses : actions/checkout@v2
@@ -38,18 +38,12 @@ jobs:
3838 docker-compose up -d
3939 cd ..
4040 - name : Setup PHP ${{ matrix.php-versions }}
41- uses : shivammathur/setup-php@v1
41+ uses : shivammathur/setup-php@v2
4242 with :
4343 php-version : ${{ matrix.php-versions }}
4444 coverage : pcov
4545 tools : pecl
46- extensions : mbstring, pdo, pdo_sqlsrv
47- - name : Install MS SQL Server deps
48- run : |
49- bash ./tests/install-sqlsrv.sh
50- sudo sed -i.bak '/^extension="pdo_sqlsrv.so"/d' /etc/php/${{ matrix.php-versions }}/cli/php.ini
51- sudo bash -c 'printf "; priority=30\nextension=pdo_sqlsrv.so\n" > /etc/php/${{ matrix.php-versions }}/mods-available/pdo_sqlsrv.ini'
52- sudo phpenmod -s cli -v ${{ matrix.php-versions }} pdo_sqlsrv
46+ extensions : mbstring, pdo, pdo_sqlite, pdo_pgsql, pdo_sqlsrv, pdo_mysql
5347 - name : Get Composer Cache Directory
5448 id : composer-cache
5549 run : echo "::set-output name=dir::$(composer config cache-files-dir)"
6559 run : |
6660 vendor/bin/phpunit --coverage-clover=coverage.xml
6761 - name : Upload coverage to Codecov
62+ continue-on-error : true # if is fork
6863 uses : codecov/codecov-action@v1
6964 with :
7065 token : ${{ secrets.CODECOV_TOKEN }}
7166 file : ./coverage.xml
72- test_postgres :
73- needs : lint
74- name : Test PostgreSQL ${{ matrix.configs.postgres-version }}
75- runs-on : ubuntu-latest
76- strategy :
77- matrix :
78- configs : [
79- {php-version: 7.2, postgres-version: 9.6},
80- {php-version: 7.3, postgres-version: 10},
81- {php-version: 7.3, postgres-version: 11}
82- ]
83- services :
84- postgres :
85- image : postgres:${{ matrix.configs.postgres-version }}
86- ports :
87- - 5432:5432
88- env :
89- POSTGRES_USER : postgres
90- POSTGRES_PASSWORD : postgres
91- POSTGRES_DB : spiral
92- options : --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3
93- steps :
94- - name : Checkout
95- uses : actions/checkout@v2
96- - name : Setup PHP ${{ matrix.configs.php-version }}
97- run : sudo update-alternatives --set php /usr/bin/php${{ matrix.configs.php-version }}
98- - name : Get Composer Cache Directory
99- id : composer-cache
100- run : echo "::set-output name=dir::$(composer config cache-files-dir)"
101- - name : Restore Composer Cache
102- uses : actions/cache@v1
103- with :
104- path : ${{ steps.composer-cache.outputs.dir }}
105- key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
106- restore-keys : ${{ runner.os }}-composer-
107- - name : Install Dependencies
108- run : composer install --no-interaction --prefer-dist
109- - name : Execute Tests
110- env :
111- DB : postgres
112- POSTGRES : ${{ matrix.configs.postgres-version }}
113- run : |
114- vendor/bin/phpunit tests/Annotated/Driver/Postgres
115- test_mariadb :
116- needs : lint
117- name : Test MariaDB ${{ matrix.configs.mariadb-version }}
118- runs-on : ubuntu-latest
119- strategy :
120- matrix :
121- configs : [
122- # {php-version: 7.2, mariadb-version: 10.2},
123- {php-version: 7.3, mariadb-version: 10.4}
124- ]
125- services :
126- mariadb :
127- image : mariadb:${{ matrix.configs.mariadb-version }}
128- ports :
129- - 23306:3306
130- env :
131- MYSQL_ROOT_PASSWORD : root
132- MYSQL_DATABASE : spiral
133- options : --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
134- steps :
135- - name : Checkout
136- uses : actions/checkout@v2
137- - name : Setup PHP ${{ matrix.configs.php-version }}
138- run : sudo update-alternatives --set php /usr/bin/php${{ matrix.configs.php-version }}
139- - name : Get Composer Cache Directory
140- id : composer-cache
141- run : echo "::set-output name=dir::$(composer config cache-files-dir)"
142- - name : Restore Composer Cache
143- uses : actions/cache@v1
144- with :
145- path : ${{ steps.composer-cache.outputs.dir }}
146- key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
147- restore-keys : ${{ runner.os }}-composer-
148- - name : Install Dependencies
149- run : composer install --no-interaction --prefer-dist
150- - name : Execute Tests
151- env :
152- DB : mariadb
153- MARIADB : ${{ matrix.configs.mariadb-version }}
154- run : |
155- vendor/bin/phpunit tests/Annotated/Driver/MySQL
0 commit comments