mirror of
https://github.com/chenasraf/workflows.git
synced 2026-05-17 17:28:03 +00:00
docs: add input examples & required column
This commit is contained in:
201
README.md
201
README.md
@@ -49,9 +49,13 @@ on:
|
||||
|
||||
jobs:
|
||||
release:
|
||||
uses: chenasraf/workflows/.github/workflows/go-release.yml@main
|
||||
uses: chenasraf/workflows/.github/workflows/go-release.yml@master
|
||||
with:
|
||||
name: my-binary
|
||||
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 }}
|
||||
```
|
||||
@@ -76,22 +80,6 @@ jobs:
|
||||
| ------------------- | ---------------------------------------- | -------- |
|
||||
| `REPO_DISPATCH_PAT` | PAT for dispatching to homebrew tap repo | No |
|
||||
|
||||
#### Example with Custom Options
|
||||
|
||||
```yaml
|
||||
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 }}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Manual Homebrew Release (`manual-homebrew-release.yml`)
|
||||
@@ -147,15 +135,23 @@ 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'
|
||||
```
|
||||
|
||||
| Input | Description | Default |
|
||||
|-------|-------------|---------|
|
||||
| `php-versions-min` | Minimum PHP version | `8.2` |
|
||||
| `php-versions-max` | Maximum PHP version | `8.3` |
|
||||
| `mysql-version` | MySQL version | `8.4` |
|
||||
| `php-extensions` | PHP extensions to install | _(common extensions)_ |
|
||||
| `path-filters` | Paths to trigger on (YAML list) | _(lib, tests, etc.)_ |
|
||||
| Input | Description | Required | Default |
|
||||
|-------|-------------|----------|---------|
|
||||
| `php-versions-min` | Minimum PHP version | No | `8.2` |
|
||||
| `php-versions-max` | Maximum PHP version | No | `8.3` |
|
||||
| `mysql-version` | MySQL version | No | `8.4` |
|
||||
| `php-extensions` | PHP extensions to install | No | _(common extensions)_ |
|
||||
| `path-filters` | Paths to trigger on (YAML list) | No | _(lib, tests, etc.)_ |
|
||||
|
||||
### PHPUnit PostgreSQL (`nextcloud-phpunit-pgsql.yml`)
|
||||
|
||||
@@ -165,13 +161,18 @@ 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/**'
|
||||
```
|
||||
|
||||
| Input | Description | Default |
|
||||
|-------|-------------|---------|
|
||||
| `php-version` | PHP version | `8.3` |
|
||||
| `php-extensions` | PHP extensions to install | _(common extensions)_ |
|
||||
| `path-filters` | Paths to trigger on (YAML list) | _(lib, tests, etc.)_ |
|
||||
| Input | Description | Required | Default |
|
||||
|-------|-------------|----------|---------|
|
||||
| `php-version` | PHP version | No | `8.3` |
|
||||
| `php-extensions` | PHP extensions to install | No | _(common extensions)_ |
|
||||
| `path-filters` | Paths to trigger on (YAML list) | No | _(lib, tests, etc.)_ |
|
||||
|
||||
### PHPUnit Incremental Migration (`nextcloud-phpunit-incremental.yml`)
|
||||
|
||||
@@ -183,14 +184,21 @@ jobs:
|
||||
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'
|
||||
```
|
||||
|
||||
| Input | Description | Default |
|
||||
|-------|-------------|---------|
|
||||
| `baseline-version` | Git tag/ref to upgrade from | **Required** |
|
||||
| `php-version` | PHP version | `8.3` |
|
||||
| `validation-query` | SQL query to validate migration | _(empty)_ |
|
||||
| `path-filters` | Paths to trigger on (YAML list) | _(lib, tests, etc.)_ |
|
||||
| Input | Description | Required | Default |
|
||||
|-------|-------------|----------|---------|
|
||||
| `baseline-version` | Git tag/ref to upgrade from | Yes | - |
|
||||
| `php-version` | PHP version | No | `8.3` |
|
||||
| `php-extensions-mysql` | PHP extensions for MySQL tests | No | _(common extensions)_ |
|
||||
| `php-extensions-pgsql` | PHP extensions for PostgreSQL tests | No | _(common extensions)_ |
|
||||
| `validation-query` | SQL query to validate migration | No | _(empty)_ |
|
||||
| `path-filters` | Paths to trigger on (YAML list) | No | _(lib, tests, etc.)_ |
|
||||
|
||||
### Psalm Static Analysis (`nextcloud-psalm.yml`)
|
||||
|
||||
@@ -200,13 +208,18 @@ 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'
|
||||
```
|
||||
|
||||
| Input | Description | Default |
|
||||
|-------|-------------|---------|
|
||||
| `psalm-command` | Command to run Psalm | `composer run psalm` |
|
||||
| `php-extensions` | PHP extensions to install | _(common extensions)_ |
|
||||
| `path-filters` | Paths to trigger on (YAML list) | `**.php`, `psalm.xml` |
|
||||
| Input | Description | Required | Default |
|
||||
|-------|-------------|----------|---------|
|
||||
| `psalm-command` | Command to run Psalm | No | `composer run psalm` |
|
||||
| `php-extensions` | PHP extensions to install | No | _(common extensions)_ |
|
||||
| `path-filters` | Paths to trigger on (YAML list) | No | `**.php`, `psalm.xml` |
|
||||
|
||||
### PHP Lint (`nextcloud-lint-php.yml`)
|
||||
|
||||
@@ -216,13 +229,18 @@ 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'
|
||||
```
|
||||
|
||||
| Input | Description | Default |
|
||||
|-------|-------------|---------|
|
||||
| `lint-command` | Command to run lint | `composer run lint` |
|
||||
| `php-extensions` | PHP extensions to install | _(common extensions)_ |
|
||||
| `path-filters` | Paths to trigger on (YAML list) | `**.php` |
|
||||
| Input | Description | Required | Default |
|
||||
|-------|-------------|----------|---------|
|
||||
| `lint-command` | Command to run lint | No | `composer run lint` |
|
||||
| `php-extensions` | PHP extensions to install | No | _(common extensions)_ |
|
||||
| `path-filters` | Paths to trigger on (YAML list) | No | `**.php` |
|
||||
|
||||
### PHP-CS-Fixer (`nextcloud-lint-php-cs.yml`)
|
||||
|
||||
@@ -232,13 +250,18 @@ 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'
|
||||
```
|
||||
|
||||
| Input | Description | Default |
|
||||
|-------|-------------|---------|
|
||||
| `cs-check-command` | Command to check code style | `composer run cs:check` |
|
||||
| `php-extensions` | PHP extensions to install | _(common extensions)_ |
|
||||
| `path-filters` | Paths to trigger on (YAML list) | `**.php`, `.php-cs-fixer.dist.php` |
|
||||
| Input | Description | Required | Default |
|
||||
|-------|-------------|----------|---------|
|
||||
| `cs-check-command` | Command to check code style | No | `composer run cs:check` |
|
||||
| `php-extensions` | PHP extensions to install | No | _(common extensions)_ |
|
||||
| `path-filters` | Paths to trigger on (YAML list) | No | `**.php`, `.php-cs-fixer.dist.php` |
|
||||
|
||||
### ESLint (`nextcloud-lint-eslint.yml`)
|
||||
|
||||
@@ -248,12 +271,17 @@ 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'
|
||||
```
|
||||
|
||||
| Input | Description | Default |
|
||||
|-------|-------------|---------|
|
||||
| `lint-command` | Command to run lint | `pnpm lint` |
|
||||
| `path-filters` | Paths to trigger on (YAML list) | `src/**`, `*.ts`, `*.js`, etc. |
|
||||
| Input | Description | Required | Default |
|
||||
|-------|-------------|----------|---------|
|
||||
| `lint-command` | Command to run lint | No | `pnpm lint` |
|
||||
| `path-filters` | Paths to trigger on (YAML list) | No | `src/**`, `*.ts`, `*.js`, etc. |
|
||||
|
||||
### OpenAPI Lint (`nextcloud-lint-openapi.yml`)
|
||||
|
||||
@@ -263,13 +291,19 @@ 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'
|
||||
```
|
||||
|
||||
| Input | Description | Default |
|
||||
|-------|-------------|---------|
|
||||
| `openapi-command` | Command to regenerate OpenAPI | `composer run openapi` |
|
||||
| `typescript-types-pattern` | Glob for TypeScript types | `src/types/openapi/openapi*.ts` |
|
||||
| `path-filters` | Paths to trigger on (YAML list) | `lib/**/*.php`, `openapi.json` |
|
||||
| Input | Description | Required | Default |
|
||||
|-------|-------------|----------|---------|
|
||||
| `openapi-command` | Command to regenerate OpenAPI | No | `composer run openapi` |
|
||||
| `typescript-types-pattern` | Glob for TypeScript types | No | `src/types/openapi/openapi*.ts` |
|
||||
| `path-filters` | Paths to trigger on (YAML list) | No | `lib/**/*.php`, `openapi.json` |
|
||||
|
||||
### AppInfo XML Lint (`nextcloud-lint-appinfo-xml.yml`)
|
||||
|
||||
@@ -279,12 +313,17 @@ 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'
|
||||
```
|
||||
|
||||
| Input | Description | Default |
|
||||
|-------|-------------|---------|
|
||||
| `schema-url` | URL to XML schema | _(Nextcloud schema)_ |
|
||||
| `path-filters` | Paths to trigger on (YAML list) | `appinfo/info.xml` |
|
||||
| Input | Description | Required | Default |
|
||||
|-------|-------------|----------|---------|
|
||||
| `xml-file` | Path to the info.xml file | No | `./appinfo/info.xml` |
|
||||
| `schema-url` | URL to XML schema | No | _(Nextcloud schema)_ |
|
||||
| `path-filters` | Paths to trigger on (YAML list) | No | `appinfo/info.xml` |
|
||||
|
||||
### NPM Build (`nextcloud-build-npm.yml`)
|
||||
|
||||
@@ -294,11 +333,18 @@ 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'
|
||||
```
|
||||
|
||||
| Input | Description | Default |
|
||||
|-------|-------------|---------|
|
||||
| `path-filters` | Paths to trigger on (YAML list) | `src/**`, `*.json`, etc. |
|
||||
| Input | Description | Required | Default |
|
||||
|-------|-------------|----------|---------|
|
||||
| `build-command` | Command to run build | No | `pnpm build` |
|
||||
| `path-filters` | Paths to trigger on (YAML list) | No | `src/**`, `*.json`, etc. |
|
||||
|
||||
### Vitest (`nextcloud-vitest.yml`)
|
||||
|
||||
@@ -308,12 +354,19 @@ 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/**'
|
||||
```
|
||||
|
||||
| Input | Description | Default |
|
||||
|-------|-------------|---------|
|
||||
| `vitest-command` | Command to run Vitest | `pnpm vitest` |
|
||||
| `path-filters` | Paths to trigger on (YAML list) | `src/**`, `*.ts`, etc. |
|
||||
| Input | Description | Required | Default |
|
||||
|-------|-------------|----------|---------|
|
||||
| `node-version` | Node.js version to use | No | `22` |
|
||||
| `test-command` | Command to run tests | No | `pnpm test:run` |
|
||||
| `path-filters` | Paths to trigger on (YAML list) | No | `src/**`, `*.ts`, etc. |
|
||||
|
||||
### Block Unconventional Commits (`nextcloud-block-unconventional-commits.yml`)
|
||||
|
||||
@@ -323,8 +376,14 @@ 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'
|
||||
```
|
||||
|
||||
| Input | Description | Required | Default |
|
||||
|-------|-------------|----------|---------|
|
||||
| `allowed-types` | Comma-separated list of allowed commit types | No | _(feat, fix, docs, etc.)_ |
|
||||
|
||||
---
|
||||
|
||||
## License
|
||||
|
||||
Reference in New Issue
Block a user