Skip to content

E2E Scheduled · manual #58

E2E Scheduled · manual

E2E Scheduled · manual #58

Workflow file for this run

name: E2E Scheduled
run-name: >-
${{
github.event_name == 'schedule'
&& 'E2E Scheduled · OP dev + NC 34'
|| 'E2E Scheduled · manual'
}}
on:
schedule:
- cron: "0 6 * * *"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: e2e-scheduled
cancel-in-progress: false
jobs:
redispatch:
name: "Redispatch as workflow_dispatch"
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
actions: write
contents: read
steps:
- name: Dispatch scheduled target
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
gh workflow run e2e-scheduled.yml \
--repo "${GITHUB_REPOSITORY}" \
--ref "${GITHUB_REF_NAME}"
cleanup_stale:
name: "Teardown stale scheduled previews"
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 15
env:
HCLOUD_TOKEN: ${{ secrets.HCLOUD_TOKEN }}
HETZNER_CA_KEY: ${{ secrets.HETZNER_CA_KEY }}
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install PullPreview CLI
id: cli
run: |
set -euo pipefail
binary="${RUNNER_TEMP}/pullpreview"
curl -fsSL -o "${binary}" "https://raw.githubusercontent.com/pullpreview/action/65df5209b58f360444525f1167f9e14803521fed/dist/pullpreview-linux-amd64"
chmod +x "${binary}"
echo "binary=${binary}" >> "$GITHUB_OUTPUT"
- name: Teardown any running sched-* instances
env:
PP_BINARY: ${{ steps.cli.outputs.binary }}
run: |
set -euo pipefail
list_file="${RUNNER_TEMP}/pullpreview-list.tsv"
if "${PP_BINARY}" list "${GITHUB_REPOSITORY}" > "${list_file}" 2>/dev/null; then
while IFS= read -r line || [[ -n "${line}" ]]; do
[[ -z "${line}" ]] && continue
name="${line%%$'\t'*}"
[[ "${name}" =~ ^gh- ]] || continue
if [[ "${line}" =~ pullpreview_label:(sched-[^][:space:]]+) ]]; then
label="${BASH_REMATCH[1]}"
echo "Tearing down stale scheduled preview: ${name} (label=${label})"
PULLPREVIEW_PROVIDER=hetzner "${PP_BINARY}" down --name "${name}" --provider hetzner || true
fi
done < "${list_file}"
fi
dev_nc34:
name: "OP dev + NC 34"
needs: [cleanup_stale]
if: >-
always() &&
needs.cleanup_stale.result == 'success' &&
github.event_name == 'workflow_dispatch'
uses: ./.github/workflows/e2e-deploy-test.yml
secrets: inherit
with:
openproject_version: dev-slim
nextcloud_version: "34"
integration_openproject_version: "3.1.1"
squash_iteration_id: "7"
preview_label: sched-dev-nc34
run_label: "OP dev + NC 34"