From 916ab813b93702794706da605ae88175270b68bc Mon Sep 17 00:00:00 2001 From: Lasse Foo-Rafn Date: Fri, 23 Aug 2024 19:01:20 +0200 Subject: [PATCH] Create test.yaml --- .github/workflows/test.yaml | 47 +++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..475fed9 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,47 @@ +name: Tests + +on: + push: + branches: [ "*" ] + pull_request: + branches: [ "*" ] + +jobs: + run-tests: + concurrency: + group: tests-${{ github.ref }}-${{ matrix.php-versions }} + cancel-in-progress: true + strategy: + matrix: + php-versions: ['8.0'] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, mysql, intl, gd, exif, iconv + coverage: pcov + - name: Get composer cache directory + id: composercache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: ${{ steps.composercache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + - name: Install Dependencies + run: composer install --no-interaction --prefer-dist --optimize-autoloader --ignore-platform-reqs + - name: Execute tests via PHPUnit + run: php -d pcov.enabled=1 -d memory_limit=4G vendor/bin/phpunit --log-junit build/logs/junit-log.xml --coverage-clover=build/logs/clover.xml + - name: Coverage Upload + env: + OTTERWISE_TOKEN: ${{ secrets.OTTERWISE_TOKEN }} + run: bash <(curl -s https://raw.githubusercontent.com/getOtterWise/bash-uploader/main/uploader.sh) --log-file build/logs/junit-log.xml + + +# todo create deploy request in PlanetScale