Modify makefile #5
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] | |
jobs: | |
php-unit-and-functional-tests: | |
runs-on: ubuntu-20.04 | |
# Docs: https://docs.github.com/en/actions/using-containerized-services | |
services: | |
postgres: | |
image: postgres:15 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: postgres | |
ports: | |
- 5432/tcp | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3 | |
strategy: | |
fail-fast: true | |
matrix: | |
php-versions: ['8.1'] | |
steps: | |
# —— Setup GitHub actions ————————————————————————————————————————————— | |
# https://github.com/actions/checkout (official) | |
- name: Git checkout placeholder-service | |
uses: actions/checkout@v3 | |
# https://github.com/shivammathur/setup-php (community) | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
coverage: none | |
tools: composer:v2 | |
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, dom, filter, gd, iconv, json, mbstring, pdo | |
env: | |
update: true | |
- name: Check PHP Version | |
run: php -v | |
# —— Composer ————————————————————————————————————————————————————————— | |
- name: Validate composer.json and composer.lock | |
run: composer validate | |
- name: Get composer cache directory | |
id: composer-cache | |
# run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
run: echo "{dir}={$(composer config cache-files-dir)}" >> $GITHUB_OUTPUT | |
- name: Cache composer dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Install Composer dependencies | |
run: composer install | |
# —— Symfony —————————————————————————————————————————————————————————— | |
# - name: Check Symfony requirements | |
# run: vendor/bin/requirements-checker | |
- name: Check the Symfony console | |
run: bin/console -V | |
# —— Code style —— (Based on this package: https://github.com/OskarStark/php-cs-fixer-ga) | |
# - name: PHP-CS-Fixer | |
# uses: docker://oskarstark/php-cs-fixer-ga | |
# with: | |
# args: --config=.php_cs.dist --diff --dry-run | |
# - name: Cache node_modules | |
# uses: actions/cache@v1 | |
# id: yarn-cache-node-modules | |
# with: | |
# path: node_modules | |
# key: ${{ runner.os }}-yarn-cache-node-modules-${{ hashFiles('**/yarn.lock') }} | |
# restore-keys: | | |
# ${{ runner.os }}-yarn-cache-node-modules- | |
#- name: Yarn install | |
# if: steps.yarn-cache-node-modules.outputs.cache-hit != 'true' | |
#run: yarn install | |
#- name: Yarn build | |
# run: yarn run encore production | |
## —— Tests ——————————————————————————————————————————————————————————— | |
- name: Run functionnal and unit tests | |
run: make citests | |
env: | |
DATABASE_URL: postgres://postgres:[email protected]:${{ job.services.postgres.ports[5432] }}/postgres?charset=UTF-8 | |
# php bin/phpunit | |
# cp .env.ci .env.test | |
# cp .env.ci .env | |
# cp phpunit.ci.xml phpunit.xml | |
# php bin/phpunit |