mirror of
https://github.com/chenasraf/workflows.git
synced 2026-05-18 09:38:59 +00:00
Compare commits
13 Commits
nextcloud-
...
homebrew-v
| Author | SHA1 | Date | |
|---|---|---|---|
| a69ee802a6 | |||
| 70151d294e | |||
| dd6e138c7a | |||
| 94a677ab82 | |||
| 5755a7bfd8 | |||
| 388711cc86 | |||
| e203813f6f | |||
| 0808232cc6 | |||
| 1df942d283 | |||
| fdc3b6d89f | |||
| f708347ed3 | |||
| 6d06d8bbc5 | |||
| 2a0c1c7c22 |
10
.editorconfig
Normal file
10
.editorconfig
Normal file
@@ -0,0 +1,10 @@
|
||||
# EditorConfig for Makefile
|
||||
root = true
|
||||
|
||||
[Makefile]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
89
.github/workflows/homebrew-release.yml
vendored
Normal file
89
.github/workflows/homebrew-release.yml
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
# Reusable Homebrew Release Workflow
|
||||
#
|
||||
# Dispatches a homebrew formula update to a tap repo.
|
||||
# Does not include any build steps — suitable for shell-only packages.
|
||||
#
|
||||
# Call from other repos:
|
||||
# jobs:
|
||||
# homebrew:
|
||||
# uses: chenasraf/workflows/.github/workflows/homebrew-release.yml@master
|
||||
# with:
|
||||
# homebrew-tap-repo: owner/homebrew-tap
|
||||
# tag: ${{ needs.release.outputs.tag_name }}
|
||||
# secrets:
|
||||
# REPO_DISPATCH_PAT: ${{ secrets.REPO_DISPATCH_PAT }}
|
||||
|
||||
name: Homebrew Release
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
homebrew-tap-repo:
|
||||
description: 'Homebrew tap repo to dispatch to (e.g., owner/homebrew-tap)'
|
||||
required: true
|
||||
type: string
|
||||
tag:
|
||||
description: 'Release tag to dispatch (e.g., v1.0.0). If empty, uses the latest release tag.'
|
||||
required: false
|
||||
type: string
|
||||
default: ''
|
||||
secrets:
|
||||
REPO_DISPATCH_PAT:
|
||||
description: 'PAT for dispatching to homebrew tap repo'
|
||||
required: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
release-homebrew:
|
||||
name: Trigger Homebrew Formula Update
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Get release info
|
||||
id: release
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
tag="${{ inputs.tag }}"
|
||||
if [[ -z "$tag" ]]; then
|
||||
tag=$(gh release view --json tagName -q .tagName)
|
||||
echo "Using latest release tag: $tag"
|
||||
else
|
||||
echo "Using provided tag: $tag"
|
||||
fi
|
||||
echo "tag=$tag" >> "$GITHUB_OUTPUT"
|
||||
|
||||
body=$(gh release view "$tag" --json body -q .body)
|
||||
echo "body<<EOF" >> "$GITHUB_OUTPUT"
|
||||
echo "$body" >> "$GITHUB_OUTPUT"
|
||||
echo "EOF" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Send dispatch to homebrew-tap
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.REPO_DISPATCH_PAT }}
|
||||
run: |
|
||||
tag="${{ steps.release.outputs.tag }}"
|
||||
repo="${{ github.event.repository.name }}"
|
||||
body=$(cat <<'BODY_EOF'
|
||||
${{ steps.release.outputs.body }}
|
||||
BODY_EOF
|
||||
)
|
||||
data=$(jq -n \
|
||||
--arg tag "$tag" \
|
||||
--arg repo "$repo" \
|
||||
--arg body "$body" \
|
||||
'{event_type: "trigger-from-release", client_payload: {tag: $tag, repo: $repo, body: $body}}')
|
||||
echo "Dispatching tag $tag from $repo"
|
||||
echo "Data: $data"
|
||||
curl -X POST \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer $GH_TOKEN" \
|
||||
"https://api.github.com/repos/${{ inputs.homebrew-tap-repo }}/dispatches" \
|
||||
-d "$data"
|
||||
echo "Dispatched tag $tag from $repo"
|
||||
echo "Created job on https://github.com/${{ inputs.homebrew-tap-repo }}/actions"
|
||||
75
.github/workflows/manual-homebrew-release.yml
vendored
Normal file
75
.github/workflows/manual-homebrew-release.yml
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
# Reusable Manual Homebrew Release Workflow
|
||||
#
|
||||
# Call from other repos:
|
||||
# jobs:
|
||||
# homebrew:
|
||||
# uses: chenasraf/workflows/.github/workflows/manual-homebrew-release.yml@master
|
||||
# with:
|
||||
# homebrew-tap-repo: owner/homebrew-tap
|
||||
# secrets:
|
||||
# REPO_DISPATCH_PAT: ${{ secrets.REPO_DISPATCH_PAT }}
|
||||
|
||||
name: Manual Homebrew Release
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
homebrew-tap-repo:
|
||||
description: 'Homebrew tap repo to dispatch to (e.g., owner/homebrew-tap)'
|
||||
required: true
|
||||
type: string
|
||||
secrets:
|
||||
REPO_DISPATCH_PAT:
|
||||
description: 'PAT for dispatching to homebrew tap repo'
|
||||
required: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
release-homebrew:
|
||||
name: Trigger Homebrew Formula Update
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Get latest release info
|
||||
id: latest
|
||||
run: |
|
||||
tag=$(gh release view --json tagName -q .tagName)
|
||||
echo "Latest release tag: $tag"
|
||||
echo "tag=$tag" >> "$GITHUB_OUTPUT"
|
||||
|
||||
body=$(gh release view --json body -q .body)
|
||||
echo "body<<EOF" >> "$GITHUB_OUTPUT"
|
||||
echo "$body" >> "$GITHUB_OUTPUT"
|
||||
echo "EOF" >> "$GITHUB_OUTPUT"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Send dispatch to homebrew-tap
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.REPO_DISPATCH_PAT }}
|
||||
run: |
|
||||
tag="${{ steps.latest.outputs.tag }}"
|
||||
repo="${{ github.event.repository.name }}"
|
||||
body=$(cat <<'BODY_EOF'
|
||||
${{ steps.latest.outputs.body }}
|
||||
BODY_EOF
|
||||
)
|
||||
data=$(jq -n \
|
||||
--arg tag "$tag" \
|
||||
--arg repo "$repo" \
|
||||
--arg body "$body" \
|
||||
'{event_type: "trigger-from-release", client_payload: {tag: $tag, repo: $repo, body: $body}}')
|
||||
echo "Dispatching tag $tag from $repo"
|
||||
echo "Data: $data"
|
||||
curl -X POST \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer $GH_TOKEN" \
|
||||
"https://api.github.com/repos/${{ inputs.homebrew-tap-repo }}/dispatches" \
|
||||
-d "$data"
|
||||
echo "Dispatched tag $tag from $repo"
|
||||
echo "Created job on https://github.com/${{ inputs.homebrew-tap-repo }}/actions"
|
||||
@@ -15,6 +15,7 @@ on:
|
||||
default: ''
|
||||
|
||||
permissions:
|
||||
pull-requests: read
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
|
||||
25
.github/workflows/nextcloud-build-npm.yml
vendored
25
.github/workflows/nextcloud-build-npm.yml
vendored
@@ -27,31 +27,40 @@ on:
|
||||
- 'pnpm-lock.yaml'
|
||||
|
||||
permissions:
|
||||
pull-requests: read
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
|
||||
outputs:
|
||||
src: ${{ steps.changes.outputs.src }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build filters
|
||||
id: build-filters
|
||||
run: |
|
||||
echo "yaml<<EOF" >> $GITHUB_OUTPUT
|
||||
echo "src:" >> $GITHUB_OUTPUT
|
||||
cat <<'INPUT_EOF' | sed 's/^/ /' >> $GITHUB_OUTPUT
|
||||
${{ inputs.path-filters }}
|
||||
INPUT_EOF
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: changes
|
||||
continue-on-error: true
|
||||
with:
|
||||
filters: |
|
||||
src:
|
||||
${{ inputs.path-filters }}
|
||||
filters: ${{ steps.build-filters.outputs.yaml }}
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: needs.changes.outputs.src != 'false'
|
||||
if: needs.changes.outputs.src == 'true'
|
||||
|
||||
name: PNPM Build
|
||||
|
||||
@@ -82,4 +91,4 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Summary status
|
||||
run: if ${{ needs.changes.outputs.src != 'false' && needs.build.result != 'success' }}; then exit 1; fi
|
||||
run: if ${{ needs.changes.outputs.src == 'true' && needs.build.result != 'success' }}; then exit 1; fi
|
||||
|
||||
49
.github/workflows/nextcloud-lint-appinfo-xml.yml
vendored
49
.github/workflows/nextcloud-lint-appinfo-xml.yml
vendored
@@ -18,13 +18,48 @@ on:
|
||||
required: false
|
||||
type: string
|
||||
default: 'https://raw.githubusercontent.com/nextcloud/appstore/master/nextcloudappstore/api/v1/release/info.xsd'
|
||||
path-filters:
|
||||
description: 'Paths to filter on (YAML format)'
|
||||
required: false
|
||||
type: string
|
||||
default: |
|
||||
- 'appinfo/info.xml'
|
||||
|
||||
permissions:
|
||||
pull-requests: read
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
outputs:
|
||||
src: ${{ steps.changes.outputs.src }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build filters
|
||||
id: build-filters
|
||||
run: |
|
||||
echo "yaml<<EOF" >> $GITHUB_OUTPUT
|
||||
echo "src:" >> $GITHUB_OUTPUT
|
||||
cat <<'INPUT_EOF' | sed 's/^/ /' >> $GITHUB_OUTPUT
|
||||
${{ inputs.path-filters }}
|
||||
INPUT_EOF
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: changes
|
||||
continue-on-error: true
|
||||
with:
|
||||
filters: ${{ steps.build-filters.outputs.yaml }}
|
||||
|
||||
xml-linters:
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: needs.changes.outputs.src == 'true'
|
||||
|
||||
name: info.xml lint
|
||||
steps:
|
||||
@@ -39,3 +74,17 @@ jobs:
|
||||
with:
|
||||
xml-file: ${{ inputs.xml-file }}
|
||||
xml-schema-file: ./info.xsd
|
||||
|
||||
summary:
|
||||
permissions:
|
||||
contents: none
|
||||
runs-on: ubuntu-latest
|
||||
needs: [changes, xml-linters]
|
||||
|
||||
if: always()
|
||||
|
||||
name: appinfo-xml-summary
|
||||
|
||||
steps:
|
||||
- name: Summary status
|
||||
run: if ${{ needs.changes.outputs.src == 'true' && needs.xml-linters.result != 'success' }}; then exit 1; fi
|
||||
|
||||
25
.github/workflows/nextcloud-lint-eslint.yml
vendored
25
.github/workflows/nextcloud-lint-eslint.yml
vendored
@@ -27,31 +27,40 @@ on:
|
||||
- 'pnpm-lock.yaml'
|
||||
|
||||
permissions:
|
||||
pull-requests: read
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
|
||||
outputs:
|
||||
src: ${{ steps.changes.outputs.src }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build filters
|
||||
id: build-filters
|
||||
run: |
|
||||
echo "yaml<<EOF" >> $GITHUB_OUTPUT
|
||||
echo "src:" >> $GITHUB_OUTPUT
|
||||
cat <<'INPUT_EOF' | sed 's/^/ /' >> $GITHUB_OUTPUT
|
||||
${{ inputs.path-filters }}
|
||||
INPUT_EOF
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: changes
|
||||
continue-on-error: true
|
||||
with:
|
||||
filters: |
|
||||
src:
|
||||
${{ inputs.path-filters }}
|
||||
filters: ${{ steps.build-filters.outputs.yaml }}
|
||||
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: needs.changes.outputs.src != 'false'
|
||||
if: needs.changes.outputs.src == 'true'
|
||||
|
||||
name: NPM lint
|
||||
|
||||
@@ -82,4 +91,4 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Summary status
|
||||
run: if ${{ needs.changes.outputs.src != 'false' && needs.lint.result != 'success' }}; then exit 1; fi
|
||||
run: if ${{ needs.changes.outputs.src == 'true' && needs.lint.result != 'success' }}; then exit 1; fi
|
||||
|
||||
52
.github/workflows/nextcloud-lint-openapi.yml
vendored
52
.github/workflows/nextcloud-lint-openapi.yml
vendored
@@ -18,15 +18,49 @@ on:
|
||||
required: false
|
||||
type: string
|
||||
default: 'src/types/openapi/openapi*.ts'
|
||||
path-filters:
|
||||
description: 'Paths to filter on (YAML format)'
|
||||
required: false
|
||||
type: string
|
||||
default: |
|
||||
- 'lib/**/*.php'
|
||||
- 'openapi.json'
|
||||
|
||||
permissions:
|
||||
pull-requests: read
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
openapi:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
if: ${{ github.repository_owner != 'nextcloud-gmbh' }}
|
||||
outputs:
|
||||
src: ${{ steps.changes.outputs.src }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build filters
|
||||
id: build-filters
|
||||
run: |
|
||||
echo "yaml<<EOF" >> $GITHUB_OUTPUT
|
||||
echo "src:" >> $GITHUB_OUTPUT
|
||||
cat <<'INPUT_EOF' | sed 's/^/ /' >> $GITHUB_OUTPUT
|
||||
${{ inputs.path-filters }}
|
||||
INPUT_EOF
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: changes
|
||||
continue-on-error: true
|
||||
with:
|
||||
filters: ${{ steps.build-filters.outputs.yaml }}
|
||||
|
||||
openapi:
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: needs.changes.outputs.src == 'true' && github.repository_owner != 'nextcloud-gmbh'
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -76,3 +110,17 @@ jobs:
|
||||
git status
|
||||
git --no-pager diff
|
||||
exit 1
|
||||
|
||||
summary:
|
||||
permissions:
|
||||
contents: none
|
||||
runs-on: ubuntu-latest
|
||||
needs: [changes, openapi]
|
||||
|
||||
if: always()
|
||||
|
||||
name: openapi-summary
|
||||
|
||||
steps:
|
||||
- name: Summary status
|
||||
run: if ${{ needs.changes.outputs.src == 'true' && needs.openapi.result != 'success' && needs.openapi.result != 'skipped' }}; then exit 1; fi
|
||||
|
||||
50
.github/workflows/nextcloud-lint-php-cs.yml
vendored
50
.github/workflows/nextcloud-lint-php-cs.yml
vendored
@@ -18,13 +18,49 @@ on:
|
||||
required: false
|
||||
type: string
|
||||
default: 'bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite'
|
||||
path-filters:
|
||||
description: 'Paths to filter on (YAML format)'
|
||||
required: false
|
||||
type: string
|
||||
default: |
|
||||
- '**.php'
|
||||
- '.php-cs-fixer.dist.php'
|
||||
|
||||
permissions:
|
||||
pull-requests: read
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
outputs:
|
||||
src: ${{ steps.changes.outputs.src }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build filters
|
||||
id: build-filters
|
||||
run: |
|
||||
echo "yaml<<EOF" >> $GITHUB_OUTPUT
|
||||
echo "src:" >> $GITHUB_OUTPUT
|
||||
cat <<'INPUT_EOF' | sed 's/^/ /' >> $GITHUB_OUTPUT
|
||||
${{ inputs.path-filters }}
|
||||
INPUT_EOF
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: changes
|
||||
continue-on-error: true
|
||||
with:
|
||||
filters: ${{ steps.build-filters.outputs.yaml }}
|
||||
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: needs.changes.outputs.src == 'true'
|
||||
|
||||
name: php-cs
|
||||
|
||||
@@ -51,3 +87,17 @@ jobs:
|
||||
|
||||
- name: Lint
|
||||
run: ${{ inputs.cs-check-command }}
|
||||
|
||||
summary:
|
||||
permissions:
|
||||
contents: none
|
||||
runs-on: ubuntu-latest
|
||||
needs: [changes, lint]
|
||||
|
||||
if: always()
|
||||
|
||||
name: php-cs-summary
|
||||
|
||||
steps:
|
||||
- name: Summary status
|
||||
run: if ${{ needs.changes.outputs.src == 'true' && needs.lint.result != 'success' }}; then exit 1; fi
|
||||
|
||||
42
.github/workflows/nextcloud-lint-php.yml
vendored
42
.github/workflows/nextcloud-lint-php.yml
vendored
@@ -18,13 +18,48 @@ on:
|
||||
required: false
|
||||
type: string
|
||||
default: 'bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite'
|
||||
path-filters:
|
||||
description: 'Paths to filter on (YAML format)'
|
||||
required: false
|
||||
type: string
|
||||
default: |
|
||||
- '**.php'
|
||||
|
||||
permissions:
|
||||
pull-requests: read
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
outputs:
|
||||
src: ${{ steps.changes.outputs.src }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build filters
|
||||
id: build-filters
|
||||
run: |
|
||||
echo "yaml<<EOF" >> $GITHUB_OUTPUT
|
||||
echo "src:" >> $GITHUB_OUTPUT
|
||||
cat <<'INPUT_EOF' | sed 's/^/ /' >> $GITHUB_OUTPUT
|
||||
${{ inputs.path-filters }}
|
||||
INPUT_EOF
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: changes
|
||||
continue-on-error: true
|
||||
with:
|
||||
filters: ${{ steps.build-filters.outputs.yaml }}
|
||||
|
||||
matrix:
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: needs.changes.outputs.src == 'true'
|
||||
outputs:
|
||||
php-versions: ${{ steps.versions.outputs.php-versions }}
|
||||
steps:
|
||||
@@ -36,7 +71,8 @@ jobs:
|
||||
|
||||
php-lint:
|
||||
runs-on: ubuntu-latest
|
||||
needs: matrix
|
||||
needs: [changes, matrix]
|
||||
if: needs.changes.outputs.src == 'true'
|
||||
strategy:
|
||||
matrix:
|
||||
php-versions: ${{fromJson(needs.matrix.outputs.php-versions)}}
|
||||
@@ -64,7 +100,7 @@ jobs:
|
||||
permissions:
|
||||
contents: none
|
||||
runs-on: ubuntu-latest
|
||||
needs: php-lint
|
||||
needs: [changes, php-lint]
|
||||
|
||||
if: always()
|
||||
|
||||
@@ -72,4 +108,4 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Summary status
|
||||
run: if ${{ needs.php-lint.result != 'success' && needs.php-lint.result != 'skipped' }}; then exit 1; fi
|
||||
run: if ${{ needs.changes.outputs.src == 'true' && needs.php-lint.result != 'success' }}; then exit 1; fi
|
||||
|
||||
@@ -47,31 +47,40 @@ on:
|
||||
- 'composer.lock'
|
||||
|
||||
permissions:
|
||||
pull-requests: read
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
|
||||
outputs:
|
||||
src: ${{ steps.changes.outputs.src }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build filters
|
||||
id: build-filters
|
||||
run: |
|
||||
echo "yaml<<EOF" >> $GITHUB_OUTPUT
|
||||
echo "src:" >> $GITHUB_OUTPUT
|
||||
cat <<'INPUT_EOF' | sed 's/^/ /' >> $GITHUB_OUTPUT
|
||||
${{ inputs.path-filters }}
|
||||
INPUT_EOF
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: changes
|
||||
continue-on-error: true
|
||||
with:
|
||||
filters: |
|
||||
src:
|
||||
${{ inputs.path-filters }}
|
||||
filters: ${{ steps.build-filters.outputs.yaml }}
|
||||
|
||||
incremental-pgsql:
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: needs.changes.outputs.src != 'false'
|
||||
if: needs.changes.outputs.src == 'true'
|
||||
|
||||
name: Incremental Migration (PostgreSQL)
|
||||
|
||||
@@ -216,7 +225,7 @@ jobs:
|
||||
incremental-mysql:
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: needs.changes.outputs.src != 'false'
|
||||
if: needs.changes.outputs.src == 'true'
|
||||
|
||||
name: Incremental Migration (MySQL)
|
||||
|
||||
@@ -368,4 +377,4 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Summary status
|
||||
run: if ${{ needs.changes.outputs.src != 'false' && (needs.incremental-pgsql.result != 'success' || needs.incremental-mysql.result != 'success') }}; then exit 1; fi
|
||||
run: if ${{ needs.changes.outputs.src == 'true' && (needs.incremental-pgsql.result != 'success' || needs.incremental-mysql.result != 'success') }}; then exit 1; fi
|
||||
|
||||
51
.github/workflows/nextcloud-phpunit-mysql.yml
vendored
51
.github/workflows/nextcloud-phpunit-mysql.yml
vendored
@@ -45,11 +45,40 @@ on:
|
||||
- 'composer.lock'
|
||||
|
||||
permissions:
|
||||
pull-requests: read
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
outputs:
|
||||
src: ${{ steps.changes.outputs.src }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build filters
|
||||
id: build-filters
|
||||
run: |
|
||||
echo "yaml<<EOF" >> $GITHUB_OUTPUT
|
||||
echo "src:" >> $GITHUB_OUTPUT
|
||||
cat <<'INPUT_EOF' | sed 's/^/ /' >> $GITHUB_OUTPUT
|
||||
${{ inputs.path-filters }}
|
||||
INPUT_EOF
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: changes
|
||||
continue-on-error: true
|
||||
with:
|
||||
filters: ${{ steps.build-filters.outputs.yaml }}
|
||||
|
||||
matrix:
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: needs.changes.outputs.src == 'true'
|
||||
outputs:
|
||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
steps:
|
||||
@@ -76,29 +105,11 @@ jobs:
|
||||
echo "matrix=$MATRIX" >> $GITHUB_OUTPUT
|
||||
echo "Generated matrix: $MATRIX"
|
||||
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
|
||||
outputs:
|
||||
src: ${{ steps.changes.outputs.src}}
|
||||
|
||||
steps:
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: changes
|
||||
continue-on-error: true
|
||||
with:
|
||||
filters: |
|
||||
src:
|
||||
${{ inputs.path-filters }}
|
||||
|
||||
phpunit-mysql:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
needs: [changes, matrix]
|
||||
if: needs.changes.outputs.src != 'false'
|
||||
if: needs.changes.outputs.src == 'true'
|
||||
|
||||
strategy:
|
||||
matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
|
||||
@@ -229,4 +240,4 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Summary status
|
||||
run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-mysql.result != 'success' }}; then exit 1; fi
|
||||
run: if ${{ needs.changes.outputs.src == 'true' && needs.phpunit-mysql.result != 'success' }}; then exit 1; fi
|
||||
|
||||
51
.github/workflows/nextcloud-phpunit-pgsql.yml
vendored
51
.github/workflows/nextcloud-phpunit-pgsql.yml
vendored
@@ -35,11 +35,40 @@ on:
|
||||
- 'composer.lock'
|
||||
|
||||
permissions:
|
||||
pull-requests: read
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
outputs:
|
||||
src: ${{ steps.changes.outputs.src }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build filters
|
||||
id: build-filters
|
||||
run: |
|
||||
echo "yaml<<EOF" >> $GITHUB_OUTPUT
|
||||
echo "src:" >> $GITHUB_OUTPUT
|
||||
cat <<'INPUT_EOF' | sed 's/^/ /' >> $GITHUB_OUTPUT
|
||||
${{ inputs.path-filters }}
|
||||
INPUT_EOF
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: changes
|
||||
continue-on-error: true
|
||||
with:
|
||||
filters: ${{ steps.build-filters.outputs.yaml }}
|
||||
|
||||
matrix:
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: needs.changes.outputs.src == 'true'
|
||||
outputs:
|
||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
steps:
|
||||
@@ -64,29 +93,11 @@ jobs:
|
||||
echo "matrix=$MATRIX" >> $GITHUB_OUTPUT
|
||||
echo "Generated matrix: $MATRIX"
|
||||
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
|
||||
outputs:
|
||||
src: ${{ steps.changes.outputs.src }}
|
||||
|
||||
steps:
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: changes
|
||||
continue-on-error: true
|
||||
with:
|
||||
filters: |
|
||||
src:
|
||||
${{ inputs.path-filters }}
|
||||
|
||||
phpunit-pgsql:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
needs: [changes, matrix]
|
||||
if: needs.changes.outputs.src != 'false'
|
||||
if: needs.changes.outputs.src == 'true'
|
||||
|
||||
strategy:
|
||||
matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
|
||||
@@ -214,4 +225,4 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Summary status
|
||||
run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-pgsql.result != 'success' }}; then exit 1; fi
|
||||
run: if ${{ needs.changes.outputs.src == 'true' && needs.phpunit-pgsql.result != 'success' }}; then exit 1; fi
|
||||
|
||||
43
.github/workflows/nextcloud-psalm.yml
vendored
43
.github/workflows/nextcloud-psalm.yml
vendored
@@ -18,13 +18,49 @@ on:
|
||||
required: false
|
||||
type: string
|
||||
default: 'bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite'
|
||||
path-filters:
|
||||
description: 'Paths to filter on (YAML format)'
|
||||
required: false
|
||||
type: string
|
||||
default: |
|
||||
- '**.php'
|
||||
- 'psalm.xml'
|
||||
|
||||
permissions:
|
||||
pull-requests: read
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
outputs:
|
||||
src: ${{ steps.changes.outputs.src }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build filters
|
||||
id: build-filters
|
||||
run: |
|
||||
echo "yaml<<EOF" >> $GITHUB_OUTPUT
|
||||
echo "src:" >> $GITHUB_OUTPUT
|
||||
cat <<'INPUT_EOF' | sed 's/^/ /' >> $GITHUB_OUTPUT
|
||||
${{ inputs.path-filters }}
|
||||
INPUT_EOF
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: changes
|
||||
continue-on-error: true
|
||||
with:
|
||||
filters: ${{ steps.build-filters.outputs.yaml }}
|
||||
|
||||
matrix:
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: needs.changes.outputs.src == 'true'
|
||||
outputs:
|
||||
ocp-matrix: ${{ steps.versions.outputs.ocp-matrix }}
|
||||
steps:
|
||||
@@ -36,7 +72,8 @@ jobs:
|
||||
|
||||
static-analysis:
|
||||
runs-on: ubuntu-latest
|
||||
needs: matrix
|
||||
needs: [changes, matrix]
|
||||
if: needs.changes.outputs.src == 'true'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJson(needs.matrix.outputs.ocp-matrix) }}
|
||||
@@ -67,7 +104,7 @@ jobs:
|
||||
|
||||
summary:
|
||||
runs-on: ubuntu-latest
|
||||
needs: static-analysis
|
||||
needs: [changes, static-analysis]
|
||||
|
||||
if: always()
|
||||
|
||||
@@ -75,4 +112,4 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Summary status
|
||||
run: if ${{ needs.static-analysis.result != 'success' }}; then exit 1; fi
|
||||
run: if ${{ needs.changes.outputs.src == 'true' && needs.static-analysis.result != 'success' }}; then exit 1; fi
|
||||
|
||||
25
.github/workflows/nextcloud-vitest.yml
vendored
25
.github/workflows/nextcloud-vitest.yml
vendored
@@ -33,31 +33,40 @@ on:
|
||||
- 'pnpm-lock.yaml'
|
||||
|
||||
permissions:
|
||||
pull-requests: read
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
|
||||
outputs:
|
||||
src: ${{ steps.changes.outputs.src }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build filters
|
||||
id: build-filters
|
||||
run: |
|
||||
echo "yaml<<EOF" >> $GITHUB_OUTPUT
|
||||
echo "src:" >> $GITHUB_OUTPUT
|
||||
cat <<'INPUT_EOF' | sed 's/^/ /' >> $GITHUB_OUTPUT
|
||||
${{ inputs.path-filters }}
|
||||
INPUT_EOF
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: changes
|
||||
continue-on-error: true
|
||||
with:
|
||||
filters: |
|
||||
src:
|
||||
${{ inputs.path-filters }}
|
||||
filters: ${{ steps.build-filters.outputs.yaml }}
|
||||
|
||||
vitest:
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: needs.changes.outputs.src != 'false'
|
||||
if: needs.changes.outputs.src == 'true'
|
||||
|
||||
name: Vitest
|
||||
|
||||
@@ -108,4 +117,4 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Summary status
|
||||
run: if ${{ needs.changes.outputs.src != 'false' && needs.vitest.result != 'success' }}; then exit 1; fi
|
||||
run: if ${{ needs.changes.outputs.src == 'true' && needs.vitest.result != 'success' }}; then exit 1; fi
|
||||
|
||||
49
Makefile
Normal file
49
Makefile
Normal file
@@ -0,0 +1,49 @@
|
||||
.PHONY: tag help
|
||||
|
||||
help:
|
||||
@echo "Usage: make tag [TAG=<name>] [VERSION=<number>]"
|
||||
@echo ""
|
||||
@echo " TAG - Tag prefix name (e.g., 'go-release', 'nextcloud')"
|
||||
@echo " Can also be set via TAG env var"
|
||||
@echo " VERSION - Version number (optional, auto-increments if omitted)"
|
||||
@echo ""
|
||||
@echo "Examples:"
|
||||
@echo " make tag TAG=go-release"
|
||||
@echo " make tag TAG=go-release VERSION=3"
|
||||
@echo " TAG=nextcloud make tag"
|
||||
|
||||
tag:
|
||||
ifndef TAG
|
||||
@read -p "Enter tag name: " tag_input; \
|
||||
if [ -z "$$tag_input" ]; then \
|
||||
echo "Error: TAG is required"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
$(MAKE) tag TAG=$$tag_input $(if $(VERSION),VERSION=$(VERSION),)
|
||||
else
|
||||
@# Auto-detect version if not provided
|
||||
$(eval _detected_version := $(shell \
|
||||
latest=$$(git tag --list '$(TAG)-v*' | sed 's/$(TAG)-v//' | sort -n | tail -1); \
|
||||
if [ -z "$$latest" ]; then echo 1; else echo $$((latest + 1)); fi \
|
||||
))
|
||||
$(eval VERSION := $(or $(VERSION),$(_detected_version)))
|
||||
@echo "Tagging with:"
|
||||
@echo " Tag version: $(TAG)-v$(VERSION)"
|
||||
@echo " Latest tag: $(TAG)-latest"
|
||||
@echo ""
|
||||
@# Create tag-specific version
|
||||
git tag -f $(TAG)-v$(VERSION)
|
||||
@# Remove old latest tag and re-create
|
||||
-git tag -d $(TAG)-latest 2>/dev/null || true
|
||||
git tag $(TAG)-latest
|
||||
@echo ""
|
||||
@echo "Tags created successfully!"
|
||||
@read -p "Push tags to remote? [Y/n] " answer; \
|
||||
answer=$${answer:-y}; \
|
||||
if echo "$$answer" | grep -iq "^y"; then \
|
||||
echo "Pushing tags to remote..."; \
|
||||
git push origin $(TAG)-v$(VERSION) $(TAG)-latest --force; \
|
||||
else \
|
||||
echo "To push tags later, run: git push origin $(TAG)-v$(VERSION) $(TAG)-latest --force"; \
|
||||
fi
|
||||
endif
|
||||
332
README.md
332
README.md
@@ -2,6 +2,26 @@
|
||||
|
||||
A collection of reusable GitHub Actions workflows.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Workflows](#workflows)
|
||||
- [Go Release](#go-release-go-releaseyml)
|
||||
- [Manual Homebrew Release](#manual-homebrew-release-manual-homebrew-releaseyml)
|
||||
- [Nextcloud Workflows](#nextcloud-workflows)
|
||||
- [PHPUnit MySQL](#phpunit-mysql-nextcloud-phpunit-mysqlyml)
|
||||
- [PHPUnit PostgreSQL](#phpunit-postgresql-nextcloud-phpunit-pgsqlyml)
|
||||
- [PHPUnit Incremental Migration](#phpunit-incremental-migration-nextcloud-phpunit-incrementalyml)
|
||||
- [Psalm Static Analysis](#psalm-static-analysis-nextcloud-psalmyml)
|
||||
- [PHP Lint](#php-lint-nextcloud-lint-phpyml)
|
||||
- [PHP-CS-Fixer](#php-cs-fixer-nextcloud-lint-php-csyml)
|
||||
- [ESLint](#eslint-nextcloud-lint-eslintyml)
|
||||
- [OpenAPI Lint](#openapi-lint-nextcloud-lint-openapiyml)
|
||||
- [AppInfo XML Lint](#appinfo-xml-lint-nextcloud-lint-appinfo-xmlyml)
|
||||
- [NPM Build](#npm-build-nextcloud-build-npmyml)
|
||||
- [Vitest](#vitest-nextcloud-vitestyml)
|
||||
- [Block Unconventional Commits](#block-unconventional-commits-nextcloud-block-unconventional-commitsyml)
|
||||
- [License](#license)
|
||||
|
||||
## Workflows
|
||||
|
||||
### Go Release (`go-release.yml`)
|
||||
@@ -29,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 }}
|
||||
```
|
||||
@@ -56,22 +80,312 @@ jobs:
|
||||
| ------------------- | ---------------------------------------- | -------- |
|
||||
| `REPO_DISPATCH_PAT` | PAT for dispatching to homebrew tap repo | No |
|
||||
|
||||
#### Example with Custom Options
|
||||
---
|
||||
|
||||
### 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
|
||||
|
||||
```yaml
|
||||
name: Manual Homebrew Release
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
release:
|
||||
uses: chenasraf/workflows/.github/workflows/go-release.yml@master
|
||||
homebrew:
|
||||
uses: chenasraf/workflows/.github/workflows/manual-homebrew-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
|
||||
|
||||
| Input | Description | Required | Default |
|
||||
| ------------------- | ------------------------------------------------ | -------- | ------- |
|
||||
| `homebrew-tap-repo` | Homebrew tap repo to dispatch to (e.g., owner/homebrew-tap) | Yes | - |
|
||||
|
||||
#### Secrets
|
||||
|
||||
| Secret | Description | Required |
|
||||
| ------------------- | ---------------------------------------- | -------- |
|
||||
| `REPO_DISPATCH_PAT` | PAT for dispatching to homebrew tap repo | Yes |
|
||||
|
||||
---
|
||||
|
||||
## 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.
|
||||
|
||||
```yaml
|
||||
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 | 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`)
|
||||
|
||||
Runs PHPUnit tests with PostgreSQL database.
|
||||
|
||||
```yaml
|
||||
jobs:
|
||||
phpunit:
|
||||
uses: chenasraf/workflows/.github/workflows/nextcloud-phpunit-pgsql.yml@nextcloud-latest
|
||||
with:
|
||||
php-version: '8.2'
|
||||
path-filters: |
|
||||
- 'lib/**'
|
||||
- 'tests/**'
|
||||
```
|
||||
|
||||
| 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`)
|
||||
|
||||
Tests database migrations by upgrading from a baseline version.
|
||||
|
||||
```yaml
|
||||
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'
|
||||
```
|
||||
|
||||
| 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`)
|
||||
|
||||
Runs Psalm static analysis across supported Nextcloud versions.
|
||||
|
||||
```yaml
|
||||
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 | 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`)
|
||||
|
||||
Runs PHP syntax linting across supported PHP versions.
|
||||
|
||||
```yaml
|
||||
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 | 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`)
|
||||
|
||||
Checks PHP code style with PHP-CS-Fixer.
|
||||
|
||||
```yaml
|
||||
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 | 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`)
|
||||
|
||||
Runs ESLint on frontend code.
|
||||
|
||||
```yaml
|
||||
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 | 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`)
|
||||
|
||||
Validates OpenAPI spec is up to date.
|
||||
|
||||
```yaml
|
||||
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 | 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`)
|
||||
|
||||
Validates `appinfo/info.xml` against schema.
|
||||
|
||||
```yaml
|
||||
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 | 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`)
|
||||
|
||||
Builds frontend assets with pnpm.
|
||||
|
||||
```yaml
|
||||
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 | 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`)
|
||||
|
||||
Runs Vitest frontend tests.
|
||||
|
||||
```yaml
|
||||
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 | 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`)
|
||||
|
||||
Blocks commits that don't follow conventional commit format.
|
||||
|
||||
```yaml
|
||||
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
|
||||
|
||||
MIT
|
||||
|
||||
Reference in New Issue
Block a user