Fix workflow syntax

This commit is contained in:
Bartek Fabiszewski 2022-03-19 19:59:49 +01:00
parent b769b94d7b
commit 1e233e5aa3

View File

@ -7,13 +7,12 @@ on:
branches: [ master ] branches: [ master ]
jobs: jobs:
unix-build: unix-tests:
runs-on: ubuntu-latest runs-on: ubuntu-latest
defaults: defaults:
run: run:
shell: bash shell: bash
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -30,54 +29,54 @@ jobs:
db-driver: sqlite db-driver: sqlite
db-dsn: sqlite:/tmp/data/sqlite/ulogger.db db-dsn: sqlite:/tmp/data/sqlite/ulogger.db
docker-options: -p 8080:80 -v /tmp/data:/data docker-options: -p 8080:80 -v /tmp/data:/data
env:
DB_DSN: "${{ matrix.config.db-dsn }}"
DB_USER: ulogger
DB_PASS: secret2
ULOGGER_URL: "http://127.0.0.1:8080"
steps: steps:
env: - uses: actions/checkout@v2
DB_DSN="${{ matrix.config.db-dsn }}" - name: Prepare for docker
DB_USER=ulogger if: ${{ matrix.config.db-driver == 'sqlite' }}
DB_PASS=secret2 run: |
ULOGGER_URL="http://127.0.0.1:8080" sudo apt-get install sqlite3
- uses: actions/checkout@v2 rm -rf /tmp/data
- name: Prepare for docker mkdir -p /tmp/data/sqlite /tmp/data/uploads
if: ${{ matrix.config.db-driver == 'sqlite' }} sqlite3 -init scripts/ulogger.sqlite /tmp/data/sqlite/ulogger.db .exit
run: | sudo useradd runner
sudo apt-get install sqlite3 sudo chown -R runner /tmp/data
rm -rf /tmp/data sudo chmod -R 777 /tmp/data
mkdir -p /tmp/data/sqlite /tmp/data/uploads - name: Build docker
sqlite3 -init scripts/ulogger.sqlite /tmp/data/sqlite/ulogger.db .exit run: docker build -t ulogger --build-arg DB_DRIVER=${{ matrix.config.db-driver }} .
sudo useradd runner - name: Run docker
sudo chown -R runner /tmp/data run: |
sudo chmod -R 777 /tmp/data docker run -d --name ulogger ${{ matrix.config.docker-options }} -e ULOGGER_ENABLE_SETUP=1 ulogger
- name: Build docker until netstat -atn 2>/dev/null | grep '8080.*LISTEN'; do sleep 1; done
run: docker build -t ulogger --build-arg DB_DRIVER=${{ matrix.config.db-driver }} . - name: Install PHP dependencies
- name: Run docker uses: php-actions/composer@v6
run: | - name: Setup node
docker run -d --name ulogger ${{ matrix.config.docker-options }} -e ULOGGER_ENABLE_SETUP=1 ulogger uses: actions/setup-node@v2
until netstat -atn 2>/dev/null | grep '8080.*LISTEN'; do sleep 1; done - name: Install node dependencies
- name: Install PHP dependencies run: npm install
uses: php-actions/composer@v6
- name: Setup node
uses: actions/setup-node@v2
- name: Install node dependencies
run: npm install
- name: PHPUnit tests - name: PHPUnit tests
uses: php-actions/phpunit@v3 uses: php-actions/phpunit@v3
with: with:
php_extensions: xdebug php_extensions: xdebug
bootstrap: vendor/autoload.php bootstrap: vendor/autoload.php
configuration: .tests/phpunit.xml configuration: .tests/phpunit.xml
args: --coverage-text args: --coverage-text
env: env:
XDEBUG_MODE: coverage XDEBUG_MODE: coverage
- name: UI tests - name: UI tests
run: npm test run: npm test
- name: JS lint - name: JS lint
run: npm run lint:js run: npm run lint:js
- name: CSS lint - name: CSS lint
run: npm run lint:css run: npm run lint:css
- name: Show docker logs on failure - name: Show docker logs on failure
if: ${{ failure() }} if: ${{ failure() }}
run: docker logs ulogger run: docker logs ulogger