From 3b15c02a925f0432c1b6fc3e67ce1908e3fcb644 Mon Sep 17 00:00:00 2001 From: Christopher Vagnetoft Date: Thu, 14 Mar 2024 17:17:01 +0100 Subject: [PATCH] Added gitea workflow --- .gitea/actions/composer-install/action.yaml | 21 ++++++++++++++++ .gitea/workflows/phpunit.yaml | 27 +++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .gitea/actions/composer-install/action.yaml create mode 100644 .gitea/workflows/phpunit.yaml diff --git a/.gitea/actions/composer-install/action.yaml b/.gitea/actions/composer-install/action.yaml new file mode 100644 index 0000000..154b2f7 --- /dev/null +++ b/.gitea/actions/composer-install/action.yaml @@ -0,0 +1,21 @@ +name: 'Install composer dependencies' +description: 'Set up caching and install dependencies' +inputs: + install-release: + description: 'If true, dont install any dev dependencies' + required: false + default: false +runs: + using: "composite" + steps: + - name: Cache composer dependencies + uses: actions/cache@v3 + with: + key: ${{ runner.OS }}-composer-cache + path: | + ~/.cache/composer + ~/.composer + restore-keys: | + ${{ runner.OS }}-composer-cache + - name: Install dependencies + run: composer install --no-progress --no-interaction --ansi diff --git a/.gitea/workflows/phpunit.yaml b/.gitea/workflows/phpunit.yaml new file mode 100644 index 0000000..32159c1 --- /dev/null +++ b/.gitea/workflows/phpunit.yaml @@ -0,0 +1,27 @@ + +name: phpunit + +on: + push: + branches: + - master + +jobs: + phpunit: + name: PHPUnit + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "latest" + tools: phpunit-bridge + extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite + coverage: xdebug + - name: Install composer dependencies + uses: ./.gitea/actions/composer-install + - name: Run PHPUnit + shell: bash + run: vendor/bin/phpunit --no-progress --testdox --display-warnings