1
0
mirror of https://github.com/excalidraw/excalidraw.git synced 2024-11-10 11:35:52 +01:00
excalidraw/.github/workflows/locales-coverage.yml

74 lines
2.4 KiB
YAML
Raw Normal View History

2020-07-07 17:30:58 +02:00
name: Build locales coverage
Add script to calculate percentage of translation (#1826) * add script to calculate percentage of translation * test translation change * change translation * test * change translation * Calculate percentages of each translation file * test * Calculate percentages of each translation file * change translation * test * test * Calculate percentages of each translation file * test * Calculate percentages of each translation file * fix workflow * test * test again * Calculate percentages of each translation file * Calculate percentages of each translation file * test * refactor * change build logic * fix types, move English first * docs added * test translation file * test * test * test * test * test * test * test * test * test * test * test * test * Calculate percentages of each translation file * let this be the final test please * Calculate percentages of each translation file * test * test * Test * Calculate percentages of each translation file * test * Calculate percentages of each translation file * test * Calculate percentages of each translation file * test * Auto commit: Calculate translation coverage * test * test * test * test * Auto commit: Calculate translation coverage * test * only on master * test * test * Auto commit: Calculate translation coverage * switch to master branch Co-authored-by: i18n automation <runner@fv-az76.2iswp1o5zimezclxzdlwqia2gf.cx.internal.cloudapp.net> Co-authored-by: i18n automation <runner@fv-az129.idlktykl4ure3gqe2lnji05orb.cx.internal.cloudapp.net> Co-authored-by: i18n automation <runner@fv-az76.pjgcdo5npjpenpqz2nk0ztqvxd.cx.internal.cloudapp.net> Co-authored-by: i18n automation <runner@fv-az33.senarqq4ucbulg04aytwntvgah.cx.internal.cloudapp.net> Co-authored-by: i18n automation <runner@fv-az51.icvemaqob4xunfekbtdiz2tu2c.cx.internal.cloudapp.net> Co-authored-by: i18n automation <runner@fv-az78.gikxu4m3dpiulftj3bftpuu3ee.cx.internal.cloudapp.net> Co-authored-by: i18n automation <runner@fv-az121.cqdewbghluceforu5pkvpnveec.cx.internal.cloudapp.net> Co-authored-by: i18n automation <runner@fv-az139.jsbds1i2htye3fh1bzwbe4ugmf.cx.internal.cloudapp.net> Co-authored-by: i18n automation <runner@fv-az50.0bg2cysi0dkefjvuua0a0kbd1h.cx.internal.cloudapp.net> Co-authored-by: i18n automation <runner@fv-az51.nhi3in4tbx4ehjtltcwuwbwsua.cx.internal.cloudapp.net>
2020-06-30 20:28:19 +02:00
on:
push:
branches:
- "l10n_master"
Add script to calculate percentage of translation (#1826) * add script to calculate percentage of translation * test translation change * change translation * test * change translation * Calculate percentages of each translation file * test * Calculate percentages of each translation file * change translation * test * test * Calculate percentages of each translation file * test * Calculate percentages of each translation file * fix workflow * test * test again * Calculate percentages of each translation file * Calculate percentages of each translation file * test * refactor * change build logic * fix types, move English first * docs added * test translation file * test * test * test * test * test * test * test * test * test * test * test * test * Calculate percentages of each translation file * let this be the final test please * Calculate percentages of each translation file * test * test * Test * Calculate percentages of each translation file * test * Calculate percentages of each translation file * test * Calculate percentages of each translation file * test * Auto commit: Calculate translation coverage * test * test * test * test * Auto commit: Calculate translation coverage * test * only on master * test * test * Auto commit: Calculate translation coverage * switch to master branch Co-authored-by: i18n automation <runner@fv-az76.2iswp1o5zimezclxzdlwqia2gf.cx.internal.cloudapp.net> Co-authored-by: i18n automation <runner@fv-az129.idlktykl4ure3gqe2lnji05orb.cx.internal.cloudapp.net> Co-authored-by: i18n automation <runner@fv-az76.pjgcdo5npjpenpqz2nk0ztqvxd.cx.internal.cloudapp.net> Co-authored-by: i18n automation <runner@fv-az33.senarqq4ucbulg04aytwntvgah.cx.internal.cloudapp.net> Co-authored-by: i18n automation <runner@fv-az51.icvemaqob4xunfekbtdiz2tu2c.cx.internal.cloudapp.net> Co-authored-by: i18n automation <runner@fv-az78.gikxu4m3dpiulftj3bftpuu3ee.cx.internal.cloudapp.net> Co-authored-by: i18n automation <runner@fv-az121.cqdewbghluceforu5pkvpnveec.cx.internal.cloudapp.net> Co-authored-by: i18n automation <runner@fv-az139.jsbds1i2htye3fh1bzwbe4ugmf.cx.internal.cloudapp.net> Co-authored-by: i18n automation <runner@fv-az50.0bg2cysi0dkefjvuua0a0kbd1h.cx.internal.cloudapp.net> Co-authored-by: i18n automation <runner@fv-az51.nhi3in4tbx4ehjtltcwuwbwsua.cx.internal.cloudapp.net>
2020-06-30 20:28:19 +02:00
jobs:
locales:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.PUSH_TRANSLATIONS_COVERAGE_PAT }}
- name: Setup Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Create report file
run: |
npm run locales-coverage
FILE_CHANGED=$(git diff src/locales/percentages.json)
if [ ! -z "${FILE_CHANGED}" ]; then
git config --global user.name 'Kostas Bariotis'
git config --global user.email 'konmpar@gmail.com'
git add src/locales/percentages.json
git commit -am "Auto commit: Calculate translation coverage"
git push
fi
- name: Find pull request number
uses: jwalton/gh-find-current-pr@v1
id: findPullRequestNumber
with:
github-token: ${{ secrets.PUSH_TRANSLATIONS_COVERAGE_PAT }}
- name: Find Comment
uses: peter-evans/find-comment@v1
id: findComment
with:
token: ${{ secrets.PUSH_TRANSLATIONS_COVERAGE_PAT }}
issue-number: ${{ steps.findPullRequestNumber.outputs.pr }}
comment-author: "kbariotis"
body-includes: "Languages check"
- name: Construct comment body
id: getCommentBody
run: |
body=$(npm run locales-coverage:comment)
comment_body="${comment_body//'%'/'%25'}"
comment_body="${comment_body//$'\n'/'%0A'}"
comment_body="${comment_body//$'\r'/'%0D'}"
echo ::set-output name=body::$comment_body
- name: Create comment
if: ${{ steps.findComment.outputs.comment-id == 0 }}
uses: peter-evans/create-or-update-comment@v1
with:
token: ${{ secrets.PUSH_TRANSLATIONS_COVERAGE_PAT }}
issue-number: ${{ steps.findPullRequestNumber.outputs.pr }}
body: ${{ steps.getCommentBody.outputs.body }}
- name: Update comment
if: ${{ steps.findComment.outputs.comment-id != 0 }}
uses: peter-evans/create-or-update-comment@v1
with:
edit-mode: "replace"
token: ${{ secrets.PUSH_TRANSLATIONS_COVERAGE_PAT }}
comment-id: ${{ steps.findComment.outputs.comment-id }}
body: ${{ steps.getCommentBody.outputs.body }}