Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ on:
- main
pull_request:
workflow_dispatch:
inputs:
branch:
description: 'Branch to run tests against (leave empty to use the selected branch above)'
type: string
schedule:
- cron: '0 */2 * * *' # Every 2 hours; controlled by ENABLE_SCHEDULED_TESTS + SCHEDULED_TESTS_UNTIL vars
- cron: "0 */2 * * *" # Every 2 hours; stop by disabling the workflow or letting SCHEDULED_TESTS_UNTIL expire

permissions:
contents: read
Expand Down Expand Up @@ -126,17 +130,12 @@ jobs:
enabled: ${{ steps.check.outputs.enabled }}
branch: ${{ steps.check.outputs.branch }}
steps:
- name: Check ENABLE_SCHEDULED_TESTS and SCHEDULED_TESTS_UNTIL
- name: Check SCHEDULED_TESTS_UNTIL
id: check
run: |
if [[ "${{ vars.ENABLE_SCHEDULED_TESTS }}" != "true" ]]; then
echo "Scheduled tests disabled (ENABLE_SCHEDULED_TESTS != true)"
echo "enabled=false" >> "$GITHUB_OUTPUT"
exit 0
fi
until_date="${{ vars.SCHEDULED_TESTS_UNTIL }}"
if [[ -z "$until_date" ]]; then
echo "No expiry date set (SCHEDULED_TESTS_UNTIL is empty)"
echo "SCHEDULED_TESTS_UNTIL not set — skipping"
echo "enabled=false" >> "$GITHUB_OUTPUT"
exit 0
fi
Expand All @@ -145,7 +144,7 @@ jobs:
if (( now <= until )); then
echo "Schedule active until $until_date"
echo "enabled=true" >> "$GITHUB_OUTPUT"
echo "branch=${{ vars.SCHEDULED_TESTS_BRANCH || 'main' }}" >> "$GITHUB_OUTPUT"
echo "branch=main" >> "$GITHUB_OUTPUT"
else
echo "Schedule window expired on $until_date"
echo "enabled=false" >> "$GITHUB_OUTPUT"
Expand All @@ -165,7 +164,7 @@ jobs:
- name: ⬇️ Checkout Repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ needs.schedule-gate.outputs.branch || github.ref }}
ref: ${{ inputs.branch || needs.schedule-gate.outputs.branch || github.ref }}

- name: 📦 Setup pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
Expand Down Expand Up @@ -224,7 +223,7 @@ jobs:
- name: ⬇️ Checkout Repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ needs.schedule-gate.outputs.branch || github.ref }}
ref: ${{ inputs.branch || needs.schedule-gate.outputs.branch || github.ref }}

- name: 📦 Setup pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
Expand Down Expand Up @@ -283,7 +282,7 @@ jobs:
- name: ⬇️ Checkout Repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ needs.schedule-gate.outputs.branch || github.ref }}
ref: ${{ inputs.branch || needs.schedule-gate.outputs.branch || github.ref }}

- name: 📦 Setup pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
Expand Down Expand Up @@ -342,7 +341,7 @@ jobs:
- name: ⬇️ Checkout Repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ needs.schedule-gate.outputs.branch || github.ref }}
ref: ${{ inputs.branch || needs.schedule-gate.outputs.branch || github.ref }}

- name: 📦 Setup pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
Expand Down Expand Up @@ -401,7 +400,7 @@ jobs:
- name: ⬇️ Checkout Repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ needs.schedule-gate.outputs.branch || github.ref }}
ref: ${{ inputs.branch || needs.schedule-gate.outputs.branch || github.ref }}

- name: 📦 Setup pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
Expand Down