diff --git a/.github/phpunit-mariadb.xml b/.github/phpunit-mariadb.xml index 8302528b29..6b0bc8e993 100644 --- a/.github/phpunit-mariadb.xml +++ b/.github/phpunit-mariadb.xml @@ -30,7 +30,7 @@ ../sources/ext - + diff --git a/.github/phpunit-mysql.xml b/.github/phpunit-mysql.xml index 65a5e24e36..6b0bc8e993 100644 --- a/.github/phpunit-mysql.xml +++ b/.github/phpunit-mysql.xml @@ -30,7 +30,7 @@ ../sources/ext - + diff --git a/.github/phpunit-postgres.xml b/.github/phpunit-postgres.xml index f1880e8393..0d274d4225 100644 --- a/.github/phpunit-postgres.xml +++ b/.github/phpunit-postgres.xml @@ -30,7 +30,7 @@ ../sources/ext - + diff --git a/.github/phpunit-webtest.xml b/.github/phpunit-webtest.xml index 9ed0021c28..2d400fb107 100644 --- a/.github/phpunit-webtest.xml +++ b/.github/phpunit-webtest.xml @@ -26,7 +26,7 @@ ../sources/ext - + diff --git a/.github/setup-database.sh b/.github/setup-database.sh index 02724a510d..412054e09d 100755 --- a/.github/setup-database.sh +++ b/.github/setup-database.sh @@ -3,8 +3,6 @@ set -e set -x -DB=$1 - # Setup a Database if [[ "$DB" == "postgres" ]] then diff --git a/.github/setup-elkarte.sh b/.github/setup-elkarte.sh index 340f7cb0e9..11d7496fb3 100755 --- a/.github/setup-elkarte.sh +++ b/.github/setup-elkarte.sh @@ -3,9 +3,6 @@ set -e set -x -DB=$1 -PHP_VERSION=$2 - # Refresh package list upfront sudo apt-get update -qq @@ -15,7 +12,7 @@ sudo apt-get install coreutils memcached -qq > /dev/null # Webserver setup if [[ "$DB" != "none" ]] then - if [[ "$WEBSERVER" != "none" ]]; then .github/setup-nginx.sh $DB $PHP_VERSION; fi + if [[ "$WEBSERVER" != "none" ]]; then .github/setup-nginx.sh "$DB" "$PHP_VERSION"; fi # Start a memcached service on localhost and the default port so we can test cache engines memcached -p 11212 -d diff --git a/.github/setup-failure.sh b/.github/setup-failure.sh deleted file mode 100755 index 55167298bd..0000000000 --- a/.github/setup-failure.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# -# "since failure is always an option" -# Perform various actions if things don't go as expected during the test -# currently only used with GHA selenium to always send coverage - -set -e -set +x - -# Passed params -DB=$1 -PHP_VERSION=$2 -CODECOV_TOKEN=$3 - -# Agents will merge all coverage data... -if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]] -then - bash <(curl -s https://codecov.io/bash) -s "/tmp" -f '*.xml' -t "${CODECOV_TOKEN}" -fi \ No newline at end of file diff --git a/.github/setup-nginx.sh b/.github/setup-nginx.sh index 82e98281f1..67027ea996 100755 --- a/.github/setup-nginx.sh +++ b/.github/setup-nginx.sh @@ -3,9 +3,6 @@ set -e set -x -DB=$1 -PHP_VERSION=$2 - DIR=$(dirname "$0") USER=$(whoami) ELKARTE_ROOT_PATH=$(realpath "$DIR/../elkarte") @@ -43,11 +40,10 @@ echo " security.limit_extensions = .php php_admin_value[memory_limit] = 128M -" > $PHP_FPM_CONF +" > "$PHP_FPM_CONF" # Add our pool config to PHP-FPM -sudo $PHP_FPM_BIN \ - --fpm-config "$DIR/php-fpm.conf" +sudo "$PHP_FPM_BIN" --fpm-config "$DIR/php-fpm.conf" # Default Nginx conf needs to be updated with correct user sudo sed -i "s/user www-data;/user $USER;/g" $NGINX_CONF diff --git a/.github/setup-results.sh b/.github/setup-results.sh index 00ca6c57f7..c2ff2fdbe9 100755 --- a/.github/setup-results.sh +++ b/.github/setup-results.sh @@ -5,19 +5,8 @@ set -e set +x -# Passed params -DB=$1 -PHP_VERSION=$2 -CODECOV_TOKEN=$3 - # Build a config string for PHPUnit -CONFIG="--verbose --configuration .github/phpunit-${DB}.xml" +CONFIG="--verbose --configuration .github/phpunit-$DB.xml" # Running PHPUnit tests vendor/bin/phpunit ${CONFIG} - -# Agents will merge all coverage data... -if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]] -then - bash <(curl -s https://codecov.io/bash) -s "/tmp" -f '*.xml' -t "${CODECOV_TOKEN}" -fi diff --git a/.github/setup-selenium.sh b/.github/setup-selenium.sh index f11aa53eaf..d138c8b4d1 100755 --- a/.github/setup-selenium.sh +++ b/.github/setup-selenium.sh @@ -6,10 +6,6 @@ set -e set -x -# Access passed params -DB=$1 -PHP_VERSION=$2 - # Some vars to make this easy to change SELENIUM_HUB_URL='http://127.0.0.1:4444' SELENIUM_JAR=/usr/share/selenium/selenium-server-standalone.jar diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index e8f1f2d3b0..9981b6c0d5 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -75,24 +75,24 @@ jobs: DB: ${{ matrix.db }} PHP_VERSION: ${{ matrix.php }} WEBSERVER: 'nginx' - run: .github/setup-elkarte.sh $DB $PHP_VERSION + run: .github/setup-elkarte.sh working-directory: ./elkarte - name: Run Unit Tests env: DB: ${{ matrix.db }} PHP_VERSION: ${{ matrix.php }} - run: .github/setup-selenium.sh $DB $PHP_VERSION + run: .github/setup-selenium.sh working-directory: ./elkarte continue-on-error: true - - name: Code Coverage - env: - DB: ${{ matrix.db }} - PHP_VERSION: ${{ matrix.php }} - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - run: .github/setup-failure.sh $DB $PHP_VERSION $CODECOV_TOKEN - working-directory: ./elkarte + - name: Send Coverage Reports + if: ${{ github.event_name == 'pull_request' }} + uses: codecov/codecov-action@v4 + with: + files: /home/runner/work/Elkarte/Elkarte/elkarte/tmp/web.xml + token: ${{ secrets.CODECOV_TOKEN }} + verbose: false - name: Server Error Log env: @@ -138,7 +138,7 @@ jobs: env: DB: ${{ matrix.db }} PHP_VERSION: ${{ matrix.php }} - run: .github/setup-elkarte.sh $DB $PHP_VERSION + run: .github/setup-elkarte.sh working-directory: ./elkarte - name: Install NodeJS @@ -223,23 +223,30 @@ jobs: env: DB: ${{steps.database-type.outputs.db}} PHP_VERSION: ${{ matrix.php }} - run: .github/setup-elkarte.sh $DB $PHP_VERSION + run: .github/setup-elkarte.sh working-directory: ./elkarte - name: Install Database env: DB: ${{steps.database-type.outputs.db}} PHP_VERSION: ${{ matrix.php }} - run: .github/setup-database.sh $DB $PHP_VERSION + run: .github/setup-database.sh working-directory: ./elkarte - name: Run Unit Tests env: DB: ${{steps.database-type.outputs.db}} PHP_VERSION: ${{ matrix.php }} - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - run: .github/setup-results.sh $DB $PHP_VERSION $CODECOV_TOKEN + run: .github/setup-results.sh working-directory: ./elkarte + + - name: Send Coverage Reports + if: ${{ github.event_name == 'pull_request' }} + uses: codecov/codecov-action@v4 + with: + files: /home/runner/work/Elkarte/Elkarte/elkarte/tmp/db.xml + token: ${{ secrets.CODECOV_TOKEN }} + verbose: false # END MySQL and MariaDB Job # START Postgres Tests @@ -303,14 +310,14 @@ jobs: env: DB: ${{steps.database-type.outputs.db}} PHP_VERSION: ${{ matrix.php }} - run: .github/setup-elkarte.sh $DB $PHP_VERSION + run: .github/setup-elkarte.sh working-directory: ./elkarte - name: Install Database env: DB: ${{steps.database-type.outputs.db}} PHP_VERSION: ${{ matrix.php }} - run: .github/setup-database.sh $DB $PHP_VERSION + run: .github/setup-database.sh working-directory: ./elkarte - name: Run Unit Tests @@ -318,6 +325,14 @@ jobs: DB: ${{steps.database-type.outputs.db}} PHP_VERSION: ${{ matrix.php }} CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - run: .github/setup-results.sh $DB $PHP_VERSION $CODECOV_TOKEN + run: .github/setup-results.sh working-directory: ./elkarte + + - name: Send Coverage Reports + if: ${{ github.event_name == 'pull_request' }} + uses: codecov/codecov-action@v4 + with: + files: /home/runner/work/Elkarte/Elkarte/elkarte/tmp/db.xml + token: ${{ secrets.CODECOV_TOKEN }} + verbose: false # END Postgres Job \ No newline at end of file