Readme

Reusable GitHub Workflows

A collection of reusable GitHub Actions workflows.

Table of Contents

Workflows

Go Release (go-release.yml)

A complete CI/CD workflow for Go projects that handles testing, cross-platform builds, releases, and Homebrew tap updates.

Features

  • Runs tests with configurable test command
  • Cross-platform builds (Linux, macOS, Windows)
  • Automated releases via release-please
  • Automatic Homebrew tap updates via repository dispatch

Usage

name: Release

on:
  push:
    branches: [master]
  pull_request:
    branches: [master]

jobs:
  release:
    uses: chenasraf/workflows/.github/workflows/go-release.yml@master
    with:
      name: my-cli
      go-version: '1.24'
      platforms: '["linux/amd64", "darwin/arm64"]'
      main-branch: main
      homebrew-tap-repo: myorg/homebrew-tap
    secrets:
      REPO_DISPATCH_PAT: ${{ secrets.REPO_DISPATCH_PAT }}

Inputs

InputDescriptionRequiredDefault
nameBinary/project nameYes-
go-versionGo version to useNo1.24
platformsJSON array of platforms to buildNo["linux/amd64", "darwin/amd64", "darwin/arm64", "windows/amd64"]
packageGo package path (empty for root)No""
compressCompress build artifactsNotrue
test-commandTest command to runNogo test -v ./...
skip-testsSkip running testsNofalse
main-branchMain branch name for releasesNomaster
homebrew-tap-repoHomebrew tap repo for dispatch (leave empty to skip)No

Secrets

SecretDescriptionRequired
REPO_DISPATCH_PATPAT for dispatching to homebrew tap repoNo

Manual Homebrew Release (manual-homebrew-release.yml)

Manually triggers a Homebrew tap update for the latest release. Useful when you need to re-trigger a Homebrew formula update without creating a new release.

Features

  • Fetches the latest release tag and body from the repository
  • Sends a repository dispatch event to your Homebrew tap repo
  • Works with any Homebrew tap that listens for trigger-from-release events with payload: { tag, repo, body }

Usage

name: Manual Homebrew Release

on:
  workflow_dispatch:

jobs:
  homebrew:
    uses: chenasraf/workflows/.github/workflows/manual-homebrew-release.yml@master
    with:
      homebrew-tap-repo: myorg/homebrew-tap
    secrets:
      REPO_DISPATCH_PAT: ${{ secrets.REPO_DISPATCH_PAT }}

Inputs

InputDescriptionRequiredDefault
homebrew-tap-repoHomebrew tap repo to dispatch to (e.g., owner/homebrew-tap)Yes-

Secrets

SecretDescriptionRequired
REPO_DISPATCH_PATPAT for dispatching to homebrew tap repoYes

Nextcloud Workflows

Reusable workflows for Nextcloud app development. These workflows include automatic path filtering to skip unnecessary runs when irrelevant files change.

PHPUnit MySQL (nextcloud-phpunit-mysql.yml)

Runs PHPUnit tests with MySQL database.

jobs:
  phpunit:
    uses: chenasraf/workflows/.github/workflows/nextcloud-phpunit-mysql.yml@nextcloud-latest
    with:
      php-versions-min: '8.1'
      php-versions-max: '8.4'
      mysql-version: '8.0'
      path-filters: |
        - 'lib/**'
        - 'tests/**'
        - 'composer.json'
InputDescriptionRequiredDefault
php-versions-minMinimum PHP versionNo8.2
php-versions-maxMaximum PHP versionNo8.3
mysql-versionMySQL versionNo8.4
php-extensionsPHP extensions to installNo(common extensions)
path-filtersPaths to trigger on (YAML list)No(lib, tests, etc.)

PHPUnit PostgreSQL (nextcloud-phpunit-pgsql.yml)

Runs PHPUnit tests with PostgreSQL database.

jobs:
  phpunit:
    uses: chenasraf/workflows/.github/workflows/nextcloud-phpunit-pgsql.yml@nextcloud-latest
    with:
      php-version: '8.2'
      path-filters: |
        - 'lib/**'
        - 'tests/**'
InputDescriptionRequiredDefault
php-versionPHP versionNo8.3
php-extensionsPHP extensions to installNo(common extensions)
path-filtersPaths to trigger on (YAML list)No(lib, tests, etc.)

PHPUnit Incremental Migration (nextcloud-phpunit-incremental.yml)

Tests database migrations by upgrading from a baseline version.

jobs:
  incremental:
    uses: chenasraf/workflows/.github/workflows/nextcloud-phpunit-incremental.yml@nextcloud-latest
    with:
      baseline-version: v1.0.0
      php-version: '8.2'
      validation-query: 'SELECT COUNT(*) FROM oc_myapp_users'
      path-filters: |
        - 'lib/Migration/**'
        - 'appinfo/info.xml'
InputDescriptionRequiredDefault
baseline-versionGit tag/ref to upgrade fromYes-
php-versionPHP versionNo8.3
php-extensions-mysqlPHP extensions for MySQL testsNo(common extensions)
php-extensions-pgsqlPHP extensions for PostgreSQL testsNo(common extensions)
validation-querySQL query to validate migrationNo(empty)
path-filtersPaths to trigger on (YAML list)No(lib, tests, etc.)

Psalm Static Analysis (nextcloud-psalm.yml)

Runs Psalm static analysis across supported Nextcloud versions.

jobs:
  psalm:
    uses: chenasraf/workflows/.github/workflows/nextcloud-psalm.yml@nextcloud-latest
    with:
      psalm-command: 'composer run psalm -- --show-info=true'
      path-filters: |
        - 'lib/**/*.php'
        - 'psalm.xml'
InputDescriptionRequiredDefault
psalm-commandCommand to run PsalmNocomposer run psalm
php-extensionsPHP extensions to installNo(common extensions)
path-filtersPaths to trigger on (YAML list)No**.php, psalm.xml

PHP Lint (nextcloud-lint-php.yml)

Runs PHP syntax linting across supported PHP versions.

jobs:
  lint:
    uses: chenasraf/workflows/.github/workflows/nextcloud-lint-php.yml@nextcloud-latest
    with:
      lint-command: 'composer run lint -- --colors'
      path-filters: |
        - 'lib/**/*.php'
        - 'appinfo/**/*.php'
InputDescriptionRequiredDefault
lint-commandCommand to run lintNocomposer run lint
php-extensionsPHP extensions to installNo(common extensions)
path-filtersPaths to trigger on (YAML list)No**.php

PHP-CS-Fixer (nextcloud-lint-php-cs.yml)

Checks PHP code style with PHP-CS-Fixer.

jobs:
  cs:
    uses: chenasraf/workflows/.github/workflows/nextcloud-lint-php-cs.yml@nextcloud-latest
    with:
      cs-check-command: 'vendor/bin/php-cs-fixer fix --dry-run --diff'
      path-filters: |
        - 'lib/**/*.php'
        - 'tests/**/*.php'
InputDescriptionRequiredDefault
cs-check-commandCommand to check code styleNocomposer run cs:check
php-extensionsPHP extensions to installNo(common extensions)
path-filtersPaths to trigger on (YAML list)No**.php, .php-cs-fixer.dist.php

ESLint (nextcloud-lint-eslint.yml)

Runs ESLint on frontend code.

jobs:
  eslint:
    uses: chenasraf/workflows/.github/workflows/nextcloud-lint-eslint.yml@nextcloud-latest
    with:
      lint-command: 'pnpm lint --max-warnings 0'
      path-filters: |
        - 'src/**/*.ts'
        - 'src/**/*.vue'
InputDescriptionRequiredDefault
lint-commandCommand to run lintNopnpm lint
path-filtersPaths to trigger on (YAML list)Nosrc/**, *.ts, *.js, etc.

OpenAPI Lint (nextcloud-lint-openapi.yml)

Validates OpenAPI spec is up to date.

jobs:
  openapi:
    uses: chenasraf/workflows/.github/workflows/nextcloud-lint-openapi.yml@nextcloud-latest
    with:
      openapi-command: 'composer run generate-openapi'
      typescript-types-pattern: 'src/api/types/*.ts'
      path-filters: |
        - 'lib/Controller/**/*.php'
        - 'openapi.json'
InputDescriptionRequiredDefault
openapi-commandCommand to regenerate OpenAPINocomposer run openapi
typescript-types-patternGlob for TypeScript typesNosrc/types/openapi/openapi*.ts
path-filtersPaths to trigger on (YAML list)Nolib/**/*.php, openapi.json

AppInfo XML Lint (nextcloud-lint-appinfo-xml.yml)

Validates appinfo/info.xml against schema.

jobs:
  xml:
    uses: chenasraf/workflows/.github/workflows/nextcloud-lint-appinfo-xml.yml@nextcloud-latest
    with:
      xml-file: './custom/path/info.xml'
      path-filters: |
        - 'custom/path/info.xml'
InputDescriptionRequiredDefault
xml-filePath to the info.xml fileNo./appinfo/info.xml
schema-urlURL to XML schemaNo(Nextcloud schema)
path-filtersPaths to trigger on (YAML list)Noappinfo/info.xml

NPM Build (nextcloud-build-npm.yml)

Builds frontend assets with pnpm.

jobs:
  build:
    uses: chenasraf/workflows/.github/workflows/nextcloud-build-npm.yml@nextcloud-latest
    with:
      build-command: 'pnpm build:prod'
      path-filters: |
        - 'src/**'
        - 'package.json'
        - 'pnpm-lock.yaml'
InputDescriptionRequiredDefault
build-commandCommand to run buildNopnpm build
path-filtersPaths to trigger on (YAML list)Nosrc/**, *.json, etc.

Vitest (nextcloud-vitest.yml)

Runs Vitest frontend tests.

jobs:
  vitest:
    uses: chenasraf/workflows/.github/workflows/nextcloud-vitest.yml@nextcloud-latest
    with:
      node-version: '20'
      test-command: 'pnpm vitest run --coverage'
      path-filters: |
        - 'src/**'
        - 'tests/**'
InputDescriptionRequiredDefault
node-versionNode.js version to useNo22
test-commandCommand to run testsNopnpm test:run
path-filtersPaths to trigger on (YAML list)Nosrc/**, *.ts, etc.

Block Unconventional Commits (nextcloud-block-unconventional-commits.yml)

Blocks commits that don’t follow conventional commit format.

jobs:
  commits:
    uses: chenasraf/workflows/.github/workflows/nextcloud-block-unconventional-commits.yml@nextcloud-latest
    with:
      allowed-types: 'feat,fix,docs,chore,refactor'
InputDescriptionRequiredDefault
allowed-typesComma-separated list of allowed commit typesNo(feat, fix, docs, etc.)

License

MIT