diff options
| author | Asko Nõmm <asko@nmm.ee> | 2026-02-01 11:41:00 +0200 |
|---|---|---|
| committer | Asko Nõmm <asko@nmm.ee> | 2026-02-01 11:41:00 +0200 |
| commit | 65a63b15b69a8315384885206027b27b9b535222 (patch) | |
| tree | 7e21d001468e907dd0a8a0fc3f0d64f5087aa817 /.forgejo/workflows | |
| parent | 142114a26452c33bbd41083be308cf8a0a3d5a2e (diff) | |
Add test workflow
Diffstat (limited to '.forgejo/workflows')
| -rw-r--r-- | .forgejo/workflows/test.yml | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/.forgejo/workflows/test.yml b/.forgejo/workflows/test.yml new file mode 100644 index 0000000..adba3b3 --- /dev/null +++ b/.forgejo/workflows/test.yml @@ -0,0 +1,38 @@ +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] +name: Test & Coverage +jobs: + test: + name: Test & Coverage + runs-on: docker + container: + image: node:20 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up php 8.3 with xdebug & composer + run: | + apt-get update + apt-get install -y ca-certificates apt-transport-https software-properties-common curl gnupg + curl -fsSL https://packages.sury.org/php/apt.gpg -o /usr/share/keyrings/sury-php.gpg + echo "deb [signed-by=/usr/share/keyrings/sury-php.gpg] https://packages.sury.org/php/ bookworm main" > /etc/apt/sources.list.d/sury-php.list + apt-get update + apt-get install -y php8.3 php8.3-cli php8.3-xdebug php8.3-mbstring php8.3-xml php8.3-curl php8.3-zip unzip + php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" + php composer-setup.php --install-dir=/usr/local/bin --filename=composer + php -r "unlink('composer-setup.php');" + echo "xdebug.mode=coverage" >> /etc/php/8.3/cli/php.ini + echo "xdebug.start_with_request=yes" >> /etc/php/8.3/cli/php.ini + php -v + composer --version + + - name: Install dependencies + run: composer install + + - name: Run tests and collect coverage + run: ./vendor/bin/phpunit tests --coverage-clover coverage.xml tests |
