Fix Github Actions
This commit is contained in:
parent
4148335db1
commit
a34d39805c
76
.github/workflows/tests.yml
vendored
76
.github/workflows/tests.yml
vendored
@ -2,9 +2,9 @@ name: Tests
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [master, github-actions]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [master]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
unix-tests:
|
unix-tests:
|
||||||
@ -15,56 +15,56 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
config:
|
db: [mysql, pgsql, sqlite]
|
||||||
- name: MySQL
|
php: ['7.4', '8.1']
|
||||||
db-driver: mysql
|
|
||||||
db-dsn: mysql:host=127.0.0.1;port=8081;dbname=ulogger;charset=utf8
|
|
||||||
docker-options: -p 8080:80 -p 8081:3306 --expose 3306
|
|
||||||
- name: PostgreSQL
|
|
||||||
db-driver: pgsql
|
|
||||||
db-dsn: pgsql:host=127.0.0.1;port=8081;dbname=ulogger
|
|
||||||
docker-options: -p 8080:80 -p 8081:5432 --expose 5432
|
|
||||||
- name: SQLite
|
|
||||||
db-driver: sqlite
|
|
||||||
db-dsn: sqlite:${{ runner.temp }}/data/sqlite/ulogger.db
|
|
||||||
docker-options: -p 8080:80 -v ${{ runner.temp }}/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:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Prepare for docker
|
- if: matrix.db == 'mysql'
|
||||||
if: ${{ matrix.config.db-driver == 'sqlite' }}
|
|
||||||
run: |
|
run: |
|
||||||
rm -rf ${{ runner.temp }}/data
|
echo "db-dsn=mysql:host=127.0.0.1;port=8081;dbname=ulogger;charset=utf8" >> $GITHUB_ENV
|
||||||
mkdir -p ${{ runner.temp }}/data/sqlite ${{ runner.temp }}/data/uploads
|
echo "docker-options=-p 8080:80 -p 8081:3306 --expose 3306" >> $GITHUB_ENV
|
||||||
sqlite3 -init scripts/ulogger.sqlite ${{ runner.temp }}/data/sqlite/ulogger.db .exit
|
- if: matrix.db == 'pgsql'
|
||||||
|
run: |
|
||||||
|
echo "db-dsn=pgsql:host=127.0.0.1;port=8081;dbname=ulogger" >> $GITHUB_ENV
|
||||||
|
echo "docker-options=-p 8080:80 -p 8081:5432 --expose 5432" >> $GITHUB_ENV
|
||||||
|
- if: matrix.db == 'sqlite'
|
||||||
|
run: |
|
||||||
|
echo "db-dsn=sqlite:${{ runner.temp }}/data/sqlite/ulogger.db" >> $GITHUB_ENV
|
||||||
|
echo "docker-options=-p 8080:80 -v ${{ runner.temp }}/data:/data" >> $GITHUB_ENV
|
||||||
|
rm -rf ${{ runner.temp }}/data
|
||||||
|
mkdir -p ${{ runner.temp }}/data/sqlite ${{ runner.temp }}/data/uploads
|
||||||
|
sqlite3 -init scripts/ulogger.sqlite ${{ runner.temp }}/data/sqlite/ulogger.db .exit
|
||||||
|
sudo chown -R runner ${{ runner.temp }}/data
|
||||||
|
sudo chmod -R 777 ${{ runner.temp }}/data
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php }}
|
||||||
|
extensions: ctype, json, pdo, pdo_${{ matrix.db }}, session, simplexml, xmlwriter, xdebug
|
||||||
|
tools: composer
|
||||||
- name: Build docker
|
- name: Build docker
|
||||||
run: docker build -t ulogger --build-arg DB_DRIVER=${{ matrix.config.db-driver }} .
|
run: docker build -t ulogger --build-arg DB_DRIVER=${{ matrix.db }} .
|
||||||
- name: Run docker
|
- name: Run docker
|
||||||
run: |
|
run: |
|
||||||
docker run -d --name ulogger ${{ matrix.config.docker-options }} -e ULOGGER_ENABLE_SETUP=1 ulogger
|
docker run -d --name ulogger ${{ env.docker-options }} -e ULOGGER_ENABLE_SETUP=1 ulogger
|
||||||
until netstat -atn 2>/dev/null | grep '8080.*LISTEN'; do sleep 1; done
|
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
|
- name: Setup node
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
- name: Install node dependencies
|
- name: Install node dependencies
|
||||||
run: npm install
|
run: npm install
|
||||||
|
- name: Install PHP dependencies
|
||||||
|
run: composer install
|
||||||
|
|
||||||
- name: PHPUnit tests
|
- name: PHPUnit tests
|
||||||
uses: php-actions/phpunit@v3
|
run: ./vendor/bin/phpunit -c .tests/phpunit.xml
|
||||||
with:
|
|
||||||
php_extensions: pdo_${{ matrix.config.db-driver }} xdebug
|
|
||||||
bootstrap: vendor/autoload.php
|
|
||||||
configuration: .tests/phpunit.xml
|
|
||||||
args: --coverage-text
|
|
||||||
env:
|
env:
|
||||||
XDEBUG_MODE: coverage
|
XDEBUG_MODE: coverage
|
||||||
|
DB_DSN: "${{ env.db-dsn }}"
|
||||||
|
DB_USER: ulogger
|
||||||
|
DB_PASS: secret2
|
||||||
|
ULOGGER_URL: "http://127.0.0.1:8080"
|
||||||
|
|
||||||
- name: UI tests
|
- name: UI tests
|
||||||
run: npm test
|
run: npm test
|
||||||
@ -72,7 +72,7 @@ jobs:
|
|||||||
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
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM alpine:3.13
|
FROM alpine:3.15
|
||||||
|
|
||||||
LABEL maintainer="Bartek Fabiszewski (https://github.com/bfabiszewski)"
|
LABEL maintainer="Bartek Fabiszewski (https://github.com/bfabiszewski)"
|
||||||
|
|
||||||
@ -33,8 +33,8 @@ COPY .docker/run.sh /run.sh
|
|||||||
RUN chmod +x /run.sh
|
RUN chmod +x /run.sh
|
||||||
COPY .docker/init.sh /init.sh
|
COPY .docker/init.sh /init.sh
|
||||||
RUN chmod +x /init.sh
|
RUN chmod +x /init.sh
|
||||||
COPY .docker/nginx.conf /etc/nginx/conf.d/default.conf
|
COPY .docker/nginx.conf /etc/nginx/http.d/default.conf
|
||||||
RUN chown nginx.nginx /etc/nginx/conf.d/default.conf
|
RUN chown nginx.nginx /etc/nginx/http.d/default.conf
|
||||||
|
|
||||||
COPY . /var/www/html
|
COPY . /var/www/html
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
"name": "bfabiszewski/ulogger-server",
|
"name": "bfabiszewski/ulogger-server",
|
||||||
"description": "ulogger server",
|
"description": "ulogger server",
|
||||||
"require": {
|
"require": {
|
||||||
|
"php": ">=7.4",
|
||||||
"ulrichsg/getopt-php": "^3.2",
|
"ulrichsg/getopt-php": "^3.2",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"ext-pdo": "*",
|
"ext-pdo": "*",
|
||||||
@ -18,5 +19,10 @@
|
|||||||
"vlucas/phpdotenv": "^5.3",
|
"vlucas/phpdotenv": "^5.3",
|
||||||
"guzzlehttp/guzzle": "^7.3",
|
"guzzlehttp/guzzle": "^7.3",
|
||||||
"kornrunner/dbunit": "^6.0"
|
"kornrunner/dbunit": "^6.0"
|
||||||
|
},
|
||||||
|
"config": {
|
||||||
|
"platform": {
|
||||||
|
"php": "7.4"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
67
composer.lock
generated
67
composer.lock
generated
@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "1a3c4445dd142c9b904638bfe4a58a63",
|
"content-hash": "49479104520ca7b03de7504b29769153",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "ulrichsg/getopt-php",
|
"name": "ulrichsg/getopt-php",
|
||||||
@ -192,16 +192,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "guzzlehttp/guzzle",
|
"name": "guzzlehttp/guzzle",
|
||||||
"version": "7.4.1",
|
"version": "7.4.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/guzzle/guzzle.git",
|
"url": "https://github.com/guzzle/guzzle.git",
|
||||||
"reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79"
|
"reference": "ac1ec1cd9b5624694c3a40be801d94137afb12b4"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/ee0a041b1760e6a53d2a39c8c34115adc2af2c79",
|
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/ac1ec1cd9b5624694c3a40be801d94137afb12b4",
|
||||||
"reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79",
|
"reference": "ac1ec1cd9b5624694c3a40be801d94137afb12b4",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -296,7 +296,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/guzzle/guzzle/issues",
|
"issues": "https://github.com/guzzle/guzzle/issues",
|
||||||
"source": "https://github.com/guzzle/guzzle/tree/7.4.1"
|
"source": "https://github.com/guzzle/guzzle/tree/7.4.2"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -312,7 +312,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2021-12-06T18:43:05+00:00"
|
"time": "2022-03-20T14:16:28+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "guzzlehttp/promises",
|
"name": "guzzlehttp/promises",
|
||||||
@ -400,16 +400,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "guzzlehttp/psr7",
|
"name": "guzzlehttp/psr7",
|
||||||
"version": "2.1.0",
|
"version": "2.2.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/guzzle/psr7.git",
|
"url": "https://github.com/guzzle/psr7.git",
|
||||||
"reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72"
|
"reference": "6565c7e0db3231e92dd5ca3bed448b30fbc89eb1"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/089edd38f5b8abba6cb01567c2a8aaa47cec4c72",
|
"url": "https://api.github.com/repos/guzzle/psr7/zipball/6565c7e0db3231e92dd5ca3bed448b30fbc89eb1",
|
||||||
"reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72",
|
"reference": "6565c7e0db3231e92dd5ca3bed448b30fbc89eb1",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -433,7 +433,7 @@
|
|||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "2.1-dev"
|
"dev-master": "2.2-dev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@ -495,7 +495,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/guzzle/psr7/issues",
|
"issues": "https://github.com/guzzle/psr7/issues",
|
||||||
"source": "https://github.com/guzzle/psr7/tree/2.1.0"
|
"source": "https://github.com/guzzle/psr7/tree/2.2.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -511,7 +511,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2021-10-06T17:43:30+00:00"
|
"time": "2022-03-20T13:51:08+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "kornrunner/dbunit",
|
"name": "kornrunner/dbunit",
|
||||||
@ -3149,25 +3149,25 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/deprecation-contracts",
|
"name": "symfony/deprecation-contracts",
|
||||||
"version": "v3.0.0",
|
"version": "v2.5.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/deprecation-contracts.git",
|
"url": "https://github.com/symfony/deprecation-contracts.git",
|
||||||
"reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced"
|
"reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/c726b64c1ccfe2896cb7df2e1331c357ad1c8ced",
|
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8",
|
||||||
"reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced",
|
"reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=8.0.2"
|
"php": ">=7.1"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-main": "3.0-dev"
|
"dev-main": "2.5-dev"
|
||||||
},
|
},
|
||||||
"thanks": {
|
"thanks": {
|
||||||
"name": "symfony/contracts",
|
"name": "symfony/contracts",
|
||||||
@ -3196,7 +3196,7 @@
|
|||||||
"description": "A generic function and convention to trigger deprecation notices",
|
"description": "A generic function and convention to trigger deprecation notices",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.0"
|
"source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -3212,7 +3212,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2021-11-01T23:48:49+00:00"
|
"time": "2021-07-12T14:48:14+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/polyfill-ctype",
|
"name": "symfony/polyfill-ctype",
|
||||||
@ -3464,27 +3464,28 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/yaml",
|
"name": "symfony/yaml",
|
||||||
"version": "v6.0.3",
|
"version": "v5.4.3",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/yaml.git",
|
"url": "https://github.com/symfony/yaml.git",
|
||||||
"reference": "e77f3ea0b21141d771d4a5655faa54f692b34af5"
|
"reference": "e80f87d2c9495966768310fc531b487ce64237a2"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/yaml/zipball/e77f3ea0b21141d771d4a5655faa54f692b34af5",
|
"url": "https://api.github.com/repos/symfony/yaml/zipball/e80f87d2c9495966768310fc531b487ce64237a2",
|
||||||
"reference": "e77f3ea0b21141d771d4a5655faa54f692b34af5",
|
"reference": "e80f87d2c9495966768310fc531b487ce64237a2",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=8.0.2",
|
"php": ">=7.2.5",
|
||||||
|
"symfony/deprecation-contracts": "^2.1|^3",
|
||||||
"symfony/polyfill-ctype": "^1.8"
|
"symfony/polyfill-ctype": "^1.8"
|
||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
"symfony/console": "<5.4"
|
"symfony/console": "<5.3"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"symfony/console": "^5.4|^6.0"
|
"symfony/console": "^5.3|^6.0"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"symfony/console": "For validating YAML files using the lint command"
|
"symfony/console": "For validating YAML files using the lint command"
|
||||||
@ -3518,7 +3519,7 @@
|
|||||||
"description": "Loads and dumps YAML files",
|
"description": "Loads and dumps YAML files",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/yaml/tree/v6.0.3"
|
"source": "https://github.com/symfony/yaml/tree/v5.4.3"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -3534,7 +3535,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-01-26T17:23:29+00:00"
|
"time": "2022-01-26T16:32:32+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "theseer/tokenizer",
|
"name": "theseer/tokenizer",
|
||||||
@ -3733,6 +3734,7 @@
|
|||||||
"prefer-stable": false,
|
"prefer-stable": false,
|
||||||
"prefer-lowest": false,
|
"prefer-lowest": false,
|
||||||
"platform": {
|
"platform": {
|
||||||
|
"php": ">=7.4",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"ext-pdo": "*",
|
"ext-pdo": "*",
|
||||||
"ext-xmlwriter": "*",
|
"ext-xmlwriter": "*",
|
||||||
@ -3740,5 +3742,8 @@
|
|||||||
"ext-libxml": "*"
|
"ext-libxml": "*"
|
||||||
},
|
},
|
||||||
"platform-dev": [],
|
"platform-dev": [],
|
||||||
|
"platform-overrides": {
|
||||||
|
"php": "7.4"
|
||||||
|
},
|
||||||
"plugin-api-version": "2.2.0"
|
"plugin-api-version": "2.2.0"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user