From 5c9900d594afebd8aacd0c2708dcef8c54802a83 Mon Sep 17 00:00:00 2001 From: Brandon Shipley Date: Wed, 26 Aug 2026 01:16:13 -0700 Subject: [PATCH] workflows gitea --- .gitea/workflows/ci.yaml | 50 ++++++++++++++--------------------- .gitea/workflows/release.yaml | 17 ++++++++++++ .gitea/workflows/status.yaml | 31 ++++++++++++++++++++++ 3 files changed, 68 insertions(+), 30 deletions(-) create mode 100644 .gitea/workflows/release.yaml create mode 100644 .gitea/workflows/status.yaml diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 85f43aa..0fa63a0 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -11,9 +11,9 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['8.2', '8.4'] - db-type: ['mysql'] - # db-type: ['sqlite', 'mysql', 'pgsql'] + php-version: ['8.2', '8.5'] + # db-type: ['mysql'] + db-type: ['sqlite', 'mysql', 'pgsql'] prefer-lowest: [''] include: - php-version: '8.2' @@ -26,20 +26,13 @@ jobs: env: MYSQL_ALLOW_EMPTY_PASSWORD: yes MYSQL_DATABASE: cakephp -# services: -# postgres: -# image: postgres -# ports: -# - 5432:5432 -# env: -# POSTGRES_PASSWORD: postgres -# mysql8: -# image: mysql:8.0 -# env: -# MYSQL_ALLOW_EMPTY_PASSWORD: yes -# MYSQL_DATABASE: test_db -# ports: -# - 3306:3306 + # services: + # postgres: + # image: postgres + # ports: + # - 5432:5432 + # env: + # POSTGRES_PASSWORD: postgres steps: - uses: actions/checkout@v4 @@ -47,7 +40,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} - extensions: mbstring, intl, sqlite, pdo_${{ matrix.db-type }} + extensions: mbstring, intl, bcmath, sqlite, pdo_${{ matrix.db-type }} coverage: pcov - name: Get composer cache directory @@ -94,11 +87,11 @@ jobs: if: matrix.prefer-lowest == 'prefer-lowest' run: vendor/bin/validate-prefer-lowest -m -# - name: Upload coverage reports to Codecov -# if: success() && matrix.php-version == '8.2' -# uses: codecov/codecov-action@v4 -# with: -# token: ${{ secrets.CODECOV_TOKEN }} + # - name: Upload coverage reports to Codecov + # if: success() && matrix.php-version == '8.2' + # uses: codecov/codecov-action@v4 + # with: + # token: ${{ secrets.CODECOV_TOKEN }} validation: name: Coding Standard & Static Analysis @@ -108,8 +101,8 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' - extensions: mbstring, intl, sqlite + php-version: '8.2' + extensions: mbstring, intl, sqlite, bcmath coverage: none - name: Get composer cache directory @@ -133,11 +126,8 @@ jobs: composer install --no-progress --prefer-dist --optimize-autoloader fi - - name: Composer phpstan setup - run: composer stan-setup - - name: Run phpstan - run: vendor/bin/phpstan analyse --error-format=github + run: vendor/bin/phpstan analyse src --error-format=github - name: Run phpcs - run: composer cs-check \ No newline at end of file + run: composer cs-check diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml new file mode 100644 index 0000000..77787fb --- /dev/null +++ b/.gitea/workflows/release.yaml @@ -0,0 +1,17 @@ +name: Release + +on: + push: + tags: + - "v*.*.*" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Release + uses: softprops/action-gh-release@v2 + + diff --git a/.gitea/workflows/status.yaml b/.gitea/workflows/status.yaml new file mode 100644 index 0000000..c703766 --- /dev/null +++ b/.gitea/workflows/status.yaml @@ -0,0 +1,31 @@ +--- +name: CI Build Status + +on: + workflow_run: + workflows: + - CI + types: + - completed +jobs: + on-success: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} + steps: + - name: Webhook + uses: zzzze/webhook-trigger@master + with: + data: "{\"text\":\"${{ gitea.repository }} build succeeded 🎉\"}" + webhook_url: ${{ secrets.BUILD_STATUS_NOTIFY_WEBHOOK_URL }} + options: "-H \"Content-Type: application/json\"" + + on-failure: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'failure' }} + steps: + - name: Webhook + uses: zzzze/webhook-trigger@master + with: + data: "{\"text\":\"${{ gitea.repository }} build failed 🔎\"}" + webhook_url: ${{ secrets.BUILD_STATUS_NOTIFY_WEBHOOK_URL }} + options: "-H \"Content-Type: application/json\""