-
Notifications
You must be signed in to change notification settings - Fork 384
94 lines (93 loc) · 3.73 KB
/
commit-checker.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
# Manually run: commit checker
name: commit-checker
on:
workflow_dispatch:
inputs:
# NB: the version numbers don't need to be updated here, they are only examples.
end-ref:
description: CLDR Commit (e.g. main or maint/maint-38)
required: true
fix-version:
description: Fix Version (e.g. 38)
required: true
last-version:
description: Last Version (e.g. 37)
required: true
tool-repository:
description: Commit Checker ICU repo
required: true
default: 'unicode-org/icu'
tool-ref:
description: Commit Checker ICU branch/tag
required: true
default: 'main'
jobs:
build:
name: Run Checker
runs-on: ubuntu-latest
steps:
- name: clone CLDR
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.end-ref }}
lfs: false # not needed here
path: cldr
fetch-depth: 0 # expensive, but we need history for the checker
- name: clone ICU for tools
uses: actions/checkout@v3
with:
repository: ${{ github.event.inputs.tool-repository }}
ref: ${{ github.event.inputs.tool-ref }}
lfs: false # not needed here
path: icu
- name: Run Check and Publish
run: |
echo "::group::Setup Checker"
END_HASH=$(cd ${GITHUB_WORKSPACE}/cldr ; git rev-parse --short HEAD )
REPORT="CLDR-Report-"$(date +"%Y-%m-%d")-v${FV}-${END_HASH}
echo $REPORT
cd icu/tools/commit-checker
command -v pipenv >/dev/null 2>/dev/null || sudo pip3 install pipenv
pipenv install -v
pipenv install -v packaging || true
echo "::endgroup::"
echo "::group::Run Checker"
pipenv run python3 check.py \
--nocopyright \
--jira-query "project=CLDR AND fixVersion=${FV}" \
--repo-root ${GITHUB_WORKSPACE}/cldr \
--fix-version ${FV} \
--commit-metadata ${GITHUB_WORKSPACE}/cldr/.github/COMMIT_METADATA.md \
--github-url https://github.com/unicode-org/cldr \
--rev-range "release-${LV}..${END_REF}" > ${GITHUB_WORKSPACE}/${REPORT}.md
echo "::endgroup::"
echo "::group::Format .html"
cd ${GITHUB_WORKSPACE}
wc -l ${REPORT}.md
npx -p markdown-to-html markdown --flavor gfm --title ${REPORT} ${REPORT}.md -c unicode-org/cldr README.md --stylesheet github-markdown.css > ${REPORT}.html
echo "::endgroup::"
echo "::group::Publish Report"
echo "${RSA_KEY_CCC}" > ${HOME}/.key && chmod go= ${HOME}/.key
echo "${CCC_KNOWNHOSTS}" > ${HOME}/.knownhosts && chmod go= ${HOME}/.knownhosts
ln ${REPORT}.md CLDR_REPORT.md # use a fixed name for the publish step
scp -o UserKnownHostsFile=${HOME}/.knownhosts -i ${HOME}/.key -P ${CCC_PORT} ${REPORT}.md ${REPORT}.html ${CCC_USER}@${CCC_HOST}:public_html/
echo "::endgroup::"
echo "Now go to https://cldr-smoke.unicode.org/cldrcc/${REPORT}.html"
env:
END_REF: ${{ github.event.inputs.end-ref }}
FV: ${{ github.event.inputs.fix-version }}
LV: ${{ github.event.inputs.last-version }}
# the RSA key for connecting
RSA_KEY_CCC: ${{ secrets.RSA_KEY_CCC }}
# the SSH port
CCC_USER: ${{ secrets.CCC_USER }}
CCC_PORT: 22
# the SSH host
CCC_HOST: cldr-smoke.unicode.org
# the ~/.ssh/known_hosts line mentioning SMOKETEST_HOST
CCC_KNOWNHOSTS: ${{ secrets.CCC_KNOWNHOSTS }}
- name: Upload CLDR_REPORT.md
uses: actions/upload-artifact@v3
with:
name: commit-checker-report
path: CLDR_REPORT.md