|
| 1 | +name: Test |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - 3.* |
| 7 | + - main |
| 8 | + pull_request: |
| 9 | + |
| 10 | +permissions: |
| 11 | + contents: read |
| 12 | + |
| 13 | +jobs: |
| 14 | + test: |
| 15 | + name: Test |
| 16 | + runs-on: ubuntu-22.04 |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 19 | + with: |
| 20 | + submodules: "true" |
| 21 | + fetch-depth: 2 |
| 22 | + - name: Setup python |
| 23 | + uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 |
| 24 | + with: |
| 25 | + python-version: "3.11" |
| 26 | + cache: "pip" |
| 27 | + - name: Configure dpkg/apt |
| 28 | + uses: abbbi/github-actions-tune@81fb919e588c20b7ab52b2cac097d2efd765c714 # v1 |
| 29 | + - name: Disable triggers from postgresql-common |
| 30 | + run: sudo sed -i '/postgresql-common/d' /var/lib/dpkg/triggers/File |
| 31 | + - name: Install system deps |
| 32 | + run: | |
| 33 | + sudo apt-get update |
| 34 | + sudo apt-get install -y hunspell hunspell-el gettext language-pack-el locales-all |
| 35 | + - name: Install python deps |
| 36 | + run: | |
| 37 | + python -m pip install -r requirements.txt |
| 38 | + - name: List packages and versions |
| 39 | + run: | |
| 40 | + pip list |
| 41 | + pospell --version |
| 42 | + powrap --version |
| 43 | + - name: Get list with updated .po archives (PR-only) |
| 44 | + if: github.event_name == 'pull_request' |
| 45 | + id: changed-po-files |
| 46 | + uses: tj-actions/changed-files@2d756ea4c53f7f6b397767d8723b3a10a9f35bf2 # v44 |
| 47 | + with: |
| 48 | + files: | |
| 49 | + **/*.po |
| 50 | + - name: Create list with .po files to check |
| 51 | + id: po-files-to-check |
| 52 | + env: |
| 53 | + PO_FILES_TO_CHECK: ${{ steps.changed-po-files.conclusion == 'skipped' && '**/*.po' || steps.changed-po-files.outputs.all_changed_files }} |
| 54 | + run: | |
| 55 | + echo "po_files_to_check=$PO_FILES_TO_CHECK" >> $GITHUB_OUTPUT |
| 56 | + echo "any_po_files_to_check=`test -n \"$PO_FILES_TO_CHECK\" && echo true || echo false`" >> $GITHUB_OUTPUT |
| 57 | + - name: Muestra outputs de steps anteriores para debugueo |
| 58 | + env: |
| 59 | + CHANGED_PO_FILES: ${{ toJson(steps.changed-po-files) }} |
| 60 | + PO_FILES_TO_CHECK: ${{ toJson(steps.po-files-to-check) }} |
| 61 | + run: | |
| 62 | + echo "steps.changed-po-files=$PO_FILES_TO_CHECK" |
| 63 | + echo "steps.po-files-to-change.$CHANGED_PO_FILES" |
| 64 | + - name: Powrap |
| 65 | + if: steps.po-files-to-check.outputs.any_po_files_to_check == 'true' |
| 66 | + run: powrap --check --quiet ${{ steps.po-files-to-check.outputs.po_files_to_check }} |
| 67 | + - name: Pospell |
| 68 | + if: steps.po-files-to-check.outputs.any_po_files_to_check == 'true' |
| 69 | + run: python scripts/check_spell.py ${{ steps.po-files-to-check.outputs.po_files_to_check }} |
0 commit comments