Skip to content

commit-checker

commit-checker #152

# 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@v4
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@v4
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