File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # GitHub Actions Workflows
2+
3+ ## ci.yml
4+
5+ The main continuous integration workflow that runs on pull requests and pushes to main/develop branches. It includes:
6+
7+ - Code linting with pre-commit hooks
8+ - Unit tests with coverage reporting
9+ - Lab discovery and parallel integration testing
10+ - Batfish JAR building and caching
11+
12+ ## daily-ci.yml
13+
14+ A scheduled workflow that runs the full CI suite daily at 8AM Pacific time. Features:
15+
16+ - Reuses the existing ` ci.yml ` workflow
17+ - Runs automatically via cron schedule: ` 0 15 * * * ` (8AM Pacific)
18+ - Can be triggered manually via ` workflow_dispatch `
19+ - Sends Slack notifications to a configured channel on failure
20+
21+ ### Setup Required
22+
23+ To enable Slack notifications, add the following secret to your repository:
24+
25+ - ` LAB_VALIDATION_SLACK_WEBHOOK_URL ` : Your Slack incoming webhook URL
26+
27+ ### Notification Details
28+
29+ The Slack notification includes:
30+
31+ - Workflow name and status
32+ - Trigger type (scheduled vs manual)
33+ - Repository and commit information
34+ - Direct link to the failed workflow run
Original file line number Diff line number Diff line change 1+ name : Daily CI
2+
3+ on :
4+ schedule :
5+ - cron : " 0 15 * * *" # 8AM Pacific; daily
6+ workflow_dispatch : # Allow manual triggering
7+
8+ jobs :
9+ # Run the existing CI workflow
10+ ci :
11+ uses : ./.github/workflows/ci.yml
12+
13+ # Send Slack notification on failure
14+ notify-slack-on-failure :
15+ needs : ci
16+ if : failure()
17+ runs-on : ubuntu-latest
18+ steps :
19+ - name : Send Slack notification on failure
20+ uses : slackapi/slack-github-action@v2.1.0
21+ with :
22+ webhook : ${{ secrets.LAB_VALIDATION_SLACK_WEBHOOK_URL }}
23+ webhook-type : incoming-webhook
24+ payload : |
25+ {
26+ "text": "*Lab validation daily CI workflow failed*",
27+ "blocks": [
28+ {
29+ "type": "section",
30+ "text": {
31+ "type": "mrkdwn",
32+ "text": "*Lab validation daily CI workflow failed*"
33+ }
34+ },
35+ {
36+ "type": "section",
37+ "fields": [
38+ {
39+ "type": "mrkdwn",
40+ "text": "*Workflow:*\n${{ github.workflow }}"
41+ },
42+ {
43+ "type": "mrkdwn",
44+ "text": "*Status:*\nFailed"
45+ },
46+ {
47+ "type": "mrkdwn",
48+ "text": "*Trigger:*\n${{ github.event_name == 'schedule' && 'Daily scheduled run' || 'Manual trigger' }}"
49+ },
50+ {
51+ "type": "mrkdwn",
52+ "text": "*Repository:*\n${{ github.repository }}"
53+ }
54+ ]
55+ },
56+ {
57+ "type": "section",
58+ "text": {
59+ "type": "mrkdwn",
60+ "text": "*Commit:* ${{ github.sha }}\n*Branch:* ${{ github.ref_name }}"
61+ }
62+ },
63+ {
64+ "type": "actions",
65+ "elements": [
66+ {
67+ "type": "button",
68+ "text": {
69+ "type": "plain_text",
70+ "text": "View Workflow Run in GitHub Actions"
71+ },
72+ "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
73+ }
74+ ]
75+ }
76+ ]
77+ }
You can’t perform that action at this time.
0 commit comments