diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml new file mode 100644 index 0000000..37654e4 --- /dev/null +++ b/.gitea/workflows/test.yml @@ -0,0 +1,62 @@ +name: Tests + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "8.4" + extensions: intl, zip, opcache + coverage: none + + - name: Cache Composer dependencies + uses: actions/cache@v4 + with: + path: ~/.composer/cache + key: composer-${{ hashFiles('composer.lock') }} + restore-keys: composer- + + - name: Install dependencies + run: composer install --no-interaction --prefer-dist + + - name: Run PHPUnit + run: vendor/bin/phpunit --testdox + + - name: Run PHPStan + run: composer phpstan + + docker-build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build prod image (final target) + uses: docker/build-push-action@v5 + with: + context: . + file: Dockerfile + target: final + push: false + + - name: Build dev image (dev target) + uses: docker/build-push-action@v5 + with: + context: . + file: Dockerfile.dev + target: dev + push: false