-
Notifications
You must be signed in to change notification settings - Fork 19
105 lines (102 loc) · 3.35 KB
/
report.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Report
on:
workflow_call:
inputs:
report_type:
required: true
type: string
date:
required: false
default: ''
type: string
secrets:
CROSSBOW_GITHUB_TOKEN:
required: true
CROSSBOW_SMTP_USER:
required: true
CROSSBOW_SMTP_PASSWORD:
required: true
CROSSBOW_ZULIP_WEBHOOK:
required: true
CROSSBOW_SLACK_WEBHOOK:
required: true
jobs:
nightly-report:
name: Send and build nightly ${{ inputs.report_type }} report
runs-on: ubuntu-latest
steps:
- name: Checkout Arrow
shell: bash
run: git clone https://github.com/apache/arrow
- name: Checkout Crossbow
uses: actions/checkout@v3
with:
# If we use github.token then the push will not trigger CI
token: ${{ secrets.CROSSBOW_GITHUB_TOKEN }}
path: crossbow
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Install Archery
shell: bash
run: pip install -e arrow/dev/archery[crossbow]
- name: Get Date
id: date
shell: bash
env:
DATE: ${{ inputs.date }}
run: |
if [ -z $DATE ]; then
DATE=$(date -I)
fi
echo "::set-output name=date::$DATE"
- name: Send Report
shell: bash
env:
CROSSBOW_GITHUB_TOKEN: ${{ secrets.CROSSBOW_GITHUB_TOKEN }}
run: |
job_prefix=nightly-${{ inputs.report_type }}-${{ steps.date.outputs.date }}
job_id=$(archery crossbow latest-prefix ${job_prefix})
echo "Sending report for job ${job_id}..."
archery crossbow report \
--send \
--sender-name Crossbow \
--sender-email '[email protected]' \
--recipient-email '[email protected]' \
--smtp-user ${{ secrets.CROSSBOW_SMTP_USER }} \
--smtp-password ${{ secrets.CROSSBOW_SMTP_PASSWORD }} \
${job_id}
echo "Sending Slack report for job ${job_id}..."
archery crossbow report-chat \
--send \
--no-fetch \
--webhook ${{ secrets.CROSSBOW_SLACK_WEBHOOK }} \
--extra-message-failure "@Jacob Wujciak @Raúl there has been some failures :cry:" \
--extra-message-success "Well done! There are no failures! :tada:" \
${job_id}
echo "Sending Zulip report for job ${job_id}..."
archery crossbow report-chat \
--send \
--no-fetch \
--webhook ${{ secrets.CROSSBOW_ZULIP_WEBHOOK }} \
${job_id}
echo "Generating ${job_id} CSV ..."
cd crossbow/csv_reports
archery crossbow report-csv \
--save \
--no-fetch \
${job_id}
- name: Commit CSV report
shell: bash
run: |
job_prefix=nightly-${{ inputs.report_type }}-${{ steps.date.outputs.date }}
cd crossbow
git pull
echo "Adding file to repo"
git add csv_reports/*.csv
echo "Commit CSV"
git -c user.name="github-actions[bot]" -c user.email="github-actions[bot]@users.noreply.github.com" \
commit -m "Auto commit ${job_prefix} CSV"
echo "Pushing to repo"
git push origin