Skip to content

Commit 8fc64ce

Browse files
committed
Add nightly.yaml to simulate full validation with the possibility to set the result using an env variable
1 parent c0a1d25 commit 8fc64ce

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

.github/workflows/nightly.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Nightly Build
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: "0 0 * * *"
6+
7+
jobs:
8+
full-validation:
9+
runs-on: ubuntu-latest
10+
environment: DEV
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Run tests (controlled via environment variable)
16+
run: |
17+
echo "Running nightly tests with environment override..."
18+
if [ -n "${{ secrets.TEST_RESULT_OVERRIDE }}" ]; then
19+
if [ "${{ secrets.TEST_RESULT_OVERRIDE }}" == "pass" ]; then
20+
echo "Tests passed by override (via environment)!"
21+
exit 0
22+
elif [ "${{ secrets.TEST_RESULT_OVERRIDE }}" == "fail" ]; then
23+
echo "Tests failed by override (via environment)!"
24+
exit 1
25+
fi
26+
else
27+
echo "Random test result mode..."
28+
if [ $((RANDOM % 2)) -eq 0 ]; then
29+
echo "Tests passed!"
30+
exit 0
31+
else
32+
echo "Tests failed!"
33+
exit 1
34+
fi
35+
fi
36+
37+
- name: Mark workflow as successful
38+
if: success()
39+
run: echo "Tests passed successfully!"

.github/workflows/labels.yaml renamed to .github/workflows/validate.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
uses: actions/github-script@v7
5050
with:
5151
script: |
52+
5253
const labels = context.payload.pull_request.labels.map(label => label.name);
5354
const hasQuickValidation = labels.includes('quick validation');
5455
const hasFullValidation = labels.includes('full validation');

0 commit comments

Comments
 (0)