diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 8c82bb6..c117f10 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -8,8 +8,13 @@ on: jobs: Sqlite: runs-on: ubuntu-latest - container: kanboard/tests:latest steps: + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.4' + extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, sqlite3, json, openssl, curl, zip, gd + tools: composer - name: Checkout Kanboard repo uses: actions/checkout@v2 with: @@ -21,18 +26,26 @@ jobs: - name: Install dependencies run: composer install --prefer-dist --no-progress --no-suggest - name: Unit tests with Sqlite - run: ./vendor/bin/phpunit -c tests/units.sqlite.xml plugins/Wiki/Test/ + run: ./vendor/bin/phpunit --log-junit junit.xml -c tests/units.sqlite.xml plugins/Wiki/Test/ + - name: Publish test results + uses: EnricoMi/publish-unit-test-result-action@v2 + if: always() + with: + files: junit.xml + check_name: Frontend Test Results Postgres: runs-on: ubuntu-latest - container: kanboard/tests:latest + # container: kanboard/tests:latest + needs: Sqlite services: postgres: - image: postgres:9.4 + image: postgres:latest env: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres - POSTGRES_DB: postgres + POSTGRES_DB: kanboard_unit_test + POSTGRES_HOST_AUTH_METHOD: trust ports: - 5432:5432 options: >- @@ -41,6 +54,12 @@ jobs: --health-timeout 5s --health-retries 5 steps: + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.4' + extensions: mbstring, xml, ctype, iconv, intl, pdo_pgsql, json, openssl, curl, zip, gd + tools: composer - name: Checkout Kanboard repo uses: actions/checkout@v2 with: @@ -54,17 +73,21 @@ jobs: - name: Unit tests with Postgres run: ./vendor/bin/phpunit -c tests/units.postgres.xml plugins/Wiki/Test/ env: - DB_HOSTNAME: postgres + DB_HOSTNAME: localhost DB_PORT: ${{ job.services.postgres.ports[5432] }} MariaDB: runs-on: ubuntu-latest - container: kanboard/tests:latest + # container: kanboard/tests:latest + needs: Sqlite services: mariadb: image: mariadb:latest env: MYSQL_ROOT_PASSWORD: secret + MARIA_ROOT_PASSWORD: secret + MARIADB_USER: root + MARIADB_DATABASE: kanboard_unit_test ports: - 3306:3306 options: >- @@ -73,6 +96,12 @@ jobs: --health-timeout 5s --health-retries 5 steps: + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.4' + extensions: mbstring, xml, ctype, iconv, intl, pdo_mysql, json, openssl, curl, zip, gd + tools: composer - name: Checkout Kanboard repo uses: actions/checkout@v2 with: @@ -86,6 +115,7 @@ jobs: - name: Unit tests with MariaDB run: ./vendor/bin/phpunit -c tests/units.mysql.xml plugins/Wiki/Test/ env: - DB_HOSTNAME: mariadb + DB_HOSTNAME: 127.0.0.1 DB_PASSWORD: secret + DB_USER: root DB_PORT: ${{ job.services.mariadb.ports[3306] }} \ No newline at end of file diff --git a/Test/Helper/WikiHelperTest.php b/Test/Helper/WikiHelperTest.php index f15cafc..d0c1de1 100644 --- a/Test/Helper/WikiHelperTest.php +++ b/Test/Helper/WikiHelperTest.php @@ -1,7 +1,7 @@