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