diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml new file mode 100644 index 0000000..41daaf9 --- /dev/null +++ b/.gitea/workflows/test.yml @@ -0,0 +1,46 @@ +name: Tests + +on: + push: + branches: [ main, master, develop ] + pull_request: + branches: [ main, master, develop ] + +jobs: + lint: + name: PHP Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Check PHP syntax + run: | + find . -name "*.php" ! -path "./vendor/*" ! -path "./tests/*" -print0 | xargs -0 -n1 php -l + echo "PHP syntax OK" + + unit: + name: Unit Tests + runs-on: ubuntu-latest + # The suite boots off the core plugin's test bootstrap, so the core must be + # checked out next to this AddOn under wp-content/plugins/. + steps: + - uses: actions/checkout@v4 + with: + path: 2meet-data-optimizer-hivepress-addon + + - name: Checkout core plugin + uses: actions/checkout@v4 + with: + repository: wpdev/2meet-data-optimizer + path: 2meet-data-optimizer + + - name: Install dependencies + working-directory: 2meet-data-optimizer-hivepress-addon + run: composer install --no-interaction --prefer-dist + + - name: Install core dev dependencies (test bootstrap needs them) + working-directory: 2meet-data-optimizer + run: composer install --no-interaction --prefer-dist + + - name: Run unit tests + working-directory: 2meet-data-optimizer-hivepress-addon + run: php vendor/bin/phpunit --configuration phpunit.xml --testdox