Merge pull request #6 from mitwork/dev #13
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: tests | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
tests: | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: true | |
matrix: | |
php: [ 8.1, 8.2, 8.3 ] | |
laravel: [ 10 ] | |
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} | |
steps: | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: dom, curl, libxml, mbstring, zip, gd | |
ini-values: error_reporting=E_ALL | |
tools: composer:v2 | |
coverage: none | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- if: ${{ matrix.bench }} | |
name: Downgrade TestBench version | |
run: | | |
composer require "orchestra/testbench=^${{ matrix.bench }}" --dev --no-update | |
- name: Install dependencies | |
run: | | |
composer require "illuminate/contracts=^${{ matrix.laravel }}" --dev --no-update | |
composer update --prefer-dist --no-interaction --no-progress | |
- name: Run Tests | |
run: vendor/bin/phpunit tests | |
services: | |
ncanode: | |
image: malikzh/ncanode | |
env: | |
NCANODE_CA_URL: "http://test.pki.gov.kz/cert/root_gost_test.cer http://test.pki.gov.kz/cert/root_rsa_test.cer http://test.pki.gov.kz/cert/root_test_gost_2022.cer http://test.pki.gov.kz/cert/nca_gost_test.cer http://test.pki.gov.kz/cert/nca_rsa_test.cer http://test.pki.gov.kz/cert/nca_gost2022_test.cer" | |
NCANODE_CRL_URL: "http://test.pki.gov.kz/crl/nca_rsa_test.crl http://test.pki.gov.kz/crl/nca_gost_test.crl http://test.pki.gov.kz/crl/nca_gost_test_2022.crl" | |
NCANODE_CRL_DELTA_URL: "http://test.pki.gov.kz/crl/nca_d_rsa_test.crl http://test.pki.gov.kz/crl/nca_d_gost_test.crl http://test.pki.gov.kz/crl/nca_d_gost_test_2022.crl" | |
NCANODE_OCSP_URL: http://test.pki.gov.kz/ocsp/ | |
NCANODE_TSP_URL: http://test.pki.gov.kz/tsp/ | |
ports: | |
- 14579:14579 | |
options: --health-cmd="wget -O - http://127.0.0.1:14579/actuator/health | grep -v DOWN || exit 1" --health-interval=20s --health-timeout=30s --health-retries=7 | |
stub-tests: | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: true | |
matrix: | |
stack: [ kalkan ] | |
laravel: [ 10 ] | |
name: Test Stubs - Laravel ${{ matrix.laravel }} - ${{ matrix.stack }} | |
steps: | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
extensions: dom, curl, libxml, mbstring, zip, gd | |
ini-values: error_reporting=E_ALL | |
tools: composer:v2 | |
coverage: none | |
- name: Setup Laravel | |
run: | | |
composer create-project laravel/laravel:^${{ matrix.laravel }} . | |
composer require mitwork/kalkan:@dev --no-interaction --no-update | |
composer config repositories.kalkan '{"type": "path", "url": "kalkan"}' --file composer.json | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
path: 'kalkan' | |
- name: Install Kalkan | |
run: | | |
composer update "mitwork/kalkan" --prefer-dist --no-interaction --no-progress -W | |
php artisan kalkan:install | |
- name: Install NPM dependencies | |
run: npm i | |
- name: Compile assets | |
run: npm run build | |
- name: Execute tests | |
run: vendor/bin/phpunit | |
env: | |
DB_CONNECTION: sqlite | |
DB_DATABASE: ":memory:" |