add docker setup #92
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
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
jobs: | |
nkcs-crm-api-test-deployment: | |
runs-on: ubuntu-latest | |
steps: | |
# To automatically get bug fixes and new Php versions for shivammathur/setup-php, | |
# change this to (see https://github.com/shivammathur/setup-php#bookmark-versioning): | |
# uses: shivammathur/setup-php@v2 | |
- uses: shivammathur/setup-php@2cb9b829437ee246e9b3cac53555a39208ca6d28 | |
with: | |
php-version: '8.3' | |
- uses: actions/checkout@v3 | |
- name: Copy .env.test.local | |
run: php -r "file_exists('.env.test.local') || copy('.env.test', '.env.test.local');" | |
- uses: php-actions/composer@v6 # or alternative dependency management | |
- uses: php-actions/phpstan@v3 | |
with: | |
path: src/ | |
- name: start mysql | |
run: sudo /etc/init.d/mysql start | |
- name: Create test database | |
run: | | |
chmod +x data/scripts/buildDatabase.sh | |
cd data/scripts | |
./buildDatabase.sh | |
cd - | |
- name: generate jwt test keys | |
run: php bin/console lexik:jwt:generate-keypair | |
- name: PHPUnit Tests | |
env: | |
XDEBUG_MODE: coverage | |
DATABASE_URL: mysql://root:[email protected]:3306/nkcs?serverVersion=5.7 | |
run: vendor/bin/phpunit tests --coverage-clover ./coverage.xml | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |