Use sqlite DB in release process to not depend on MySQL #1152
Workflow file for this run
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: Integration | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-22.04 | |
name: PHPUnit & Behat | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.2' | |
extensions: openssl, sodium | |
coverage: xdebug | |
tools: composer | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/*' | |
cache: 'yarn' | |
- name: Get composer cache directory | |
id: composer-cache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache composer dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Install dependencies | |
run: composer install --no-scripts | |
- name: Prepare Database Schema | |
run: bin/console doctrine:schema:create --env=test | |
- name: Prepare Assets | |
run: | | |
yarn install --frozen-lockfile | |
yarn encore dev | |
- name: PHPUnit | |
run: | | |
bin/console doctrine:fixtures:load --group=basic --env=test --no-interaction | |
bin/phpunit | |
- name: Behat | |
run: | | |
bin/console cache:clear --env=test | |
bin/behat --format progress | |
- name: SonarCloud Scan | |
uses: sonarsource/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
test-mariadb: | |
runs-on: ubuntu-latest | |
name: Behat (MariaDB) | |
needs: test | |
services: | |
mariadb: | |
image: mariadb:10.11 | |
ports: | |
- 3306 | |
env: | |
MYSQL_USER: mail_test | |
MYSQL_PASSWORD: password | |
MYSQL_DATABASE: mail_test | |
MYSQL_ROOT_PASSWORD: password | |
options: >- | |
--health-cmd="mysqladmin ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.2' | |
extensions: openssl, sodium, mysql | |
tools: composer | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/*' | |
cache: 'yarn' | |
- name: Get composer cache directory | |
id: composer-cache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache composer dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Integration with MariaDB | |
run: make integration | |
env: | |
DATABASE_DRIVER: pdo_mysql | |
DATABASE_URL: mysql://mail_test:[email protected]:${{ job.services.mariadb.ports[3306] }}/mail | |
test-postgres: | |
runs-on: ubuntu-latest | |
name: Behat (PostgreSQL) | |
needs: test | |
services: | |
postgres: | |
image: postgres:15 | |
ports: | |
- 5432 | |
env: | |
POSTGRES_USER: mail_test | |
POSTGRES_PASSWORD: password | |
POSTGRES_DB: mail_test | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.2' | |
extensions: openssl, sodium, pgsql | |
tools: composer | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/*' | |
cache: 'yarn' | |
- name: Get composer cache directory | |
id: composer-cache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache composer dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Integration with PostgreSQL | |
run: make integration | |
env: | |
DATABASE_DRIVER: pdo_pgsql | |
DATABASE_URL: pgsql://mail_test:[email protected]:${{ job.services.postgres.ports[5432] }}/mail?charset=UTF8 | |
docker: | |
runs-on: ubuntu-22.04 | |
name: Build & Push Docker Image | |
needs: test | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Login to Docker Hub | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Docker Build | |
run: docker build -t docker.io/systemli/userli . | |
- name: Docker Push | |
if: github.ref == 'refs/heads/main' | |
run: docker push docker.io/systemli/userli |