. #708
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: nextion2text | |
on: | |
workflow_dispatch: | |
pull_request: | |
paths: | |
- HMI/nspanel.HMI | |
- HMI/US/portrait/nspanel_US_P.HMI | |
- HMI/US/portrait/diff-ignore/cardEntities.txt | |
- HMI/US/landscape/nspanel_US_L.HMI | |
- .github/workflows/nextion2text.yml | |
push: | |
branches: | |
- main | |
paths: | |
- HMI/nspanel.HMI | |
- HMI/US/portrait/nspanel_US_P.HMI | |
- HMI/US/portrait/diff-ignore/cardEntities.txt | |
- HMI/US/landscape/nspanel_US_L.HMI | |
- .github/workflows/nextion2text.yml | |
jobs: | |
gen-nextion-to-text: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Get last commit message | |
id: last-commit-message | |
run: | | |
echo "::set-output name=msg::$(git log -1 --pretty=%s)" | |
- name: Download n2t | |
continue-on-error: true | |
run: | | |
wget https://raw.githubusercontent.com/joBr99/Nextion2Text/master/linux/Nextion2Text.py && sudo apt update && sudo apt install -y diffoscope | |
- name: Run n2t EU | |
continue-on-error: true | |
run: | | |
python Nextion2Text.py -s -d -p -p visual -i HMI/nspanel.HMI -o HMI/n2t-out-visual | |
- name: Run n2t US | |
continue-on-error: true | |
run: | | |
python Nextion2Text.py -s -d -p -p visual -i HMI/US/portrait/nspanel_US_P.HMI -o HMI/US/portrait/n2t-out-visual | |
python Nextion2Text.py -s -d -p -p visual -i HMI/US/landscape/nspanel_US_L.HMI -o HMI/US/landscape/n2t-out-visual | |
- name: Run n2t US P DIFF | |
continue-on-error: true | |
run: | | |
echo "YXR0cmlidXRlcyA9IHsKICAgICJpZCI6IHsKICAgICAgICAiaWdub3JlIjogVHJ1ZSwKICAgICAgICAibmFtZSI6ICJJRCIsCiAgICAgICAgInN0cnVjdCI6ICJpIiwKICAgIH0sCiAgICAiZGlzdXAiOiB7CiAgICAgICAgImlnbm9yZSI6IFRydWUsCiAgICAgICAgIm5hbWUiOiAiRGlzYWJsZSByZWxlYXNlIGV2ZW50IGFmdGVyIGRyYWdnaW5nIiwKICAgICAgICAic3RydWN0IjogImkiLAogICAgfSwKfQ==" | base64 -d > ignore-id.py | |
python Nextion2Text.py -c ignore-id.py -p font -d -i HMI/nspanel.HMI -o HMI/n2t-out | |
echo portrait | |
python Nextion2Text.py -c ignore-id.py -p font -d -i HMI/US/portrait/nspanel_US_P.HMI -o HMI/US/portrait/n2t-out | |
diffoscope --exclude=pageTest.txt --exclude-directory-metadata=recursive HMI/n2t-out HMI/US/portrait/n2t-out > HMI/US/portrait/diff-eu-version.txt | |
#diff -bur HMI/n2t-out HMI/US/portrait/n2t-out > HMI/US/portrait/diff-eu-version.txt | |
- name: Run n2t US P DIFF DIFF | |
continue-on-error: true | |
run: | | |
diff -u <(cut -b13- HMI/US/portrait/diff-eu-version-known-good.txt) <(cut -b13- HMI/US/portrait/diff-eu-version.txt) | grep -E "^\+" > HMI/US/portrait/diff-filtered.txt | |
#diff -u HMI/US/portrait/diff-eu-version-known-good.txt | grep -E "^\+" > HMI/US/portrait/diff-filtered.txt | |
- name: Run n2t US L DIFF | |
continue-on-error: true | |
run: | | |
echo landscape | |
python Nextion2Text.py -c ignore-id.py -p font -d -i HMI/US/landscape/nspanel_US_L.HMI -o HMI/US/landscape/n2t-out | |
#diff -bur HMI/n2t-out HMI/US/landscape/n2t-out > HMI/US/landscape/diff-eu-version.txt | |
diffoscope --exclude=pageTest.txt --exclude-directory-metadata=recursive HMI/n2t-out HMI/US/landscape/n2t-out > HMI/US/landscape/diff-eu-version.txt | |
- name: Display txt files | |
continue-on-error: true | |
run: | | |
find -name "**.txt" | |
rm Nextion2Text.py* ignore-id.py out.txt | |
- uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: ${{ steps.last-commit-message.outputs.msg }} (add nextion2text) | |
#file_pattern: "**.txt" |