* ci: add zizmor workflow audit Runs zizmor over this repository's workflows and Dependabot config on every pull request, on pushes to the default branch and weekly, through owncloud/reusable-workflows' zizmor.yml. Any finding fails the check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com> * fix(ci): resolve zizmor findings - excessive-permissions: workflows without a permissions block ran with the repository default, which is read/write. They now default to contents: read; only create-github-release gets contents: write, for softprops/action-gh-release. audit-release only GETs the published release, which read covers. - cache-poisoning: the release workflow's setup-node steps opt out of package-manager caching, so a tag build cannot restore a cache that a branch build wrote. - artipacked: checkouts do not persist credentials. No job runs a git operation after checkout. - dependabot-cooldown: every ecosystem waits 7 days, as github-actions already does. - ref-version-mismatch: setup-php's tag is 2.40.0, without the v. - self-repository: local reusable workflows and actions are called as $/... instead of ./... . - Suppressed inline, with the reason on the line: the unpinned `npm install -g yarn npx` in the release workflow (pre-existing, left to the maintainers), the version-pinned gherlint install, and the softprops release step, which CI cannot exercise. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com> * fix(ci): undo two zizmor auto-fix slips, keep scheduled runs - zizmor's template-injection auto-fix read `${{ }}` inside a shell comment in determine-release-type as an expansion: it added an env entry reading that job's own output, which is always empty, and rewrote the comment to describe something no longer true. The entry is gone and the comment describes the env indirection the later jobs now use, with the version check as a second safeguard. - Only pull request runs of the zizmor audit cancel each other now; a push to master and the weekly run share a ref. The previous commit's message is incomplete: it lists a self-repository change this repository did not need, and omits the auto-fixed template-injection findings (expressions in run: moved to env: in release.yml, release-npm-packages.yml and acceptance-tests.yml) and the cache-poisoning fix also turning off setup-go's cache in the release jobs, so a tag build cannot restore a cache a branch build wrote. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com> --------- Signed-off-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com> Co-authored-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
119 lines
4.2 KiB
YAML
119 lines
4.2 KiB
YAML
name: Test Deployment Examples
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: "0 1 * * *"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test:
|
|
name: ${{ matrix.example }}
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 120
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- example: ocis_full
|
|
urls: "https://ocis.owncloud.test https://collabora.owncloud.test"
|
|
ocisUrls: "https://ocis.owncloud.test"
|
|
# - example: ocis_hello
|
|
# urls: "https://ocis.owncloud.test"
|
|
- example: ocis_ldap
|
|
urls: "https://ocis.owncloud.test https://ldap.owncloud.test"
|
|
ocisUrls: "https://ocis.owncloud.test"
|
|
- example: ocis_multi
|
|
urls: "https://ocis.owncloud.test https://ocis.ocm.owncloud.test https://keycloak.owncloud.test https://ldap.owncloud.test"
|
|
- example: ocis_ocm
|
|
urls: "https://ocis.owncloud.test https://ocis.ocm.owncloud.test https://ocis.ocm.next.owncloud.test https://collabora.ocm.owncloud.test https://onlyoffice.owncloud.test"
|
|
composeFiles: "-f docker-compose.yml -f ocis.yml -f ocis-ocm.yml -f ocis-ocm-next.yml -f collabora-ocm.yml -f onlyoffice.yml"
|
|
ocisUrls: "https://ocis.owncloud.test https://ocis.ocm.owncloud.test https://ocis.ocm.next.owncloud.test"
|
|
- example: ocis_keycloak
|
|
urls: "https://ocis.owncloud.test https://keycloak.owncloud.test"
|
|
|
|
steps:
|
|
- name: Checkout ocis repo
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
repository: owncloud/ocis
|
|
persist-credentials: false
|
|
|
|
- name: Prepare hosts entry
|
|
run: |
|
|
echo "127.0.0.1 ocis.owncloud.test collabora.owncloud.test keycloak.owncloud.test mail.owncloud.test minio.owncloud.test onlyoffice.owncloud.test tika ldap.owncloud.test ocis.ocm.owncloud.test ocis.ocm.next.owncloud.test collabora.ocm.owncloud.test" | sudo tee -a /etc/hosts
|
|
|
|
- name: Run compose stack
|
|
working-directory: deployments/examples/${{ matrix.example }}
|
|
run: |
|
|
set -e
|
|
echo "=== Running ${{ matrix.example }} ==="
|
|
|
|
if [ "${{ matrix.example }}" = "ocis_ocm" ]; then
|
|
export INSECURE=true
|
|
export COLLABORA_SSL_ENABLE=false
|
|
export COLLABORA_SSL_VERIFICATION=false
|
|
fi
|
|
|
|
if [ -n "${{ matrix.ocisUrls }}" ]; then
|
|
export PROXY_ENABLE_BASIC_AUTH=true
|
|
fi
|
|
|
|
docker compose ${{ matrix.composeFiles }} up -d --wait --wait-timeout 120
|
|
|
|
- name: Wait for services
|
|
run: |
|
|
set -e
|
|
|
|
URLS="${{ matrix.urls }}"
|
|
|
|
for url in $URLS; do
|
|
echo "=== Waiting for $url ==="
|
|
|
|
end=$((SECONDS+150))
|
|
ready=false
|
|
|
|
while [ $SECONDS -lt $end ]; do
|
|
echo "Trying $url"
|
|
if curl -kfsS --max-time 5 "$url" > /dev/null; then
|
|
echo "✅ $url is ready"
|
|
ready=true
|
|
break
|
|
fi
|
|
echo "⏳ Not ready yet, retrying in 5s..."
|
|
sleep 5
|
|
done
|
|
|
|
if [ "$ready" = false ]; then
|
|
echo "❌ $url never became ready"
|
|
exit 1
|
|
fi
|
|
done
|
|
- name: Basic upload/download test
|
|
if: matrix.ocisUrls
|
|
run: |
|
|
set -e
|
|
|
|
for URL in ${{ matrix.ocisUrls }}; do
|
|
FILE="upload-test-$RANDOM.txt"
|
|
echo "hello from deployment-test $(date +%s)" > "$FILE"
|
|
|
|
echo "=== Uploading $FILE to $URL ==="
|
|
curl -kfsS -u admin:admin -T "$FILE" "$URL/remote.php/dav/files/admin/$FILE"
|
|
|
|
echo "=== Downloading $FILE back from $URL ==="
|
|
curl -kfsS -u admin:admin "$URL/remote.php/dav/files/admin/$FILE" -o "downloaded-$FILE"
|
|
|
|
echo "=== Verifying downloaded content matches what was uploaded ==="
|
|
diff "$FILE" "downloaded-$FILE"
|
|
echo "upload/download succeeded for $URL"
|
|
done
|
|
|
|
- name: Tear down
|
|
if: always()
|
|
working-directory: deployments/examples/${{ matrix.example }}
|
|
run: docker compose ${{ matrix.composeFiles }} down -v
|