Add main workflow #3
Workflow file for this run
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: Test | |
on: | |
push: | |
branches: | |
- 3.* | |
- main | |
pull_request: | |
permissions: | |
contents: read | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
submodules: "true" | |
fetch-depth: 2 | |
- name: Setup python | |
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 | |
with: | |
python-version: "3.11" | |
cache: "pip" | |
- name: Configure dpkg/apt | |
uses: abbbi/github-actions-tune@81fb919e588c20b7ab52b2cac097d2efd765c714 # v1 | |
- name: Disable triggers from postgresql-common | |
run: sudo sed -i '/postgresql-common/d' /var/lib/dpkg/triggers/File | |
- name: Install system deps | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y hunspell hunspell-el gettext language-pack-el locales-all | |
- name: Install python deps | |
run: | | |
python -m pip install -r requirements.txt | |
- name: List packages and versions | |
run: | | |
pip list | |
pospell --version | |
powrap --version | |
- name: Get list with updated .po archives (PR-only) | |
if: github.event_name == 'pull_request' | |
id: changed-po-files | |
uses: tj-actions/changed-files@2d756ea4c53f7f6b397767d8723b3a10a9f35bf2 # v44 | |
with: | |
files: | | |
**/*.po | |
- name: Create list with .po files to check | |
id: po-files-to-check | |
env: | |
PO_FILES_TO_CHECK: ${{ steps.changed-po-files.conclusion == 'skipped' && '**/*.po' || steps.changed-po-files.outputs.all_changed_files }} | |
run: | | |
echo "po_files_to_check=$PO_FILES_TO_CHECK" >> $GITHUB_OUTPUT | |
echo "any_po_files_to_check=`test -n \"$PO_FILES_TO_CHECK\" && echo true || echo false`" >> $GITHUB_OUTPUT | |
- name: Muestra outputs de steps anteriores para debugueo | |
env: | |
CHANGED_PO_FILES: ${{ toJson(steps.changed-po-files) }} | |
PO_FILES_TO_CHECK: ${{ toJson(steps.po-files-to-check) }} | |
run: | | |
echo "steps.changed-po-files=$PO_FILES_TO_CHECK" | |
echo "steps.po-files-to-change.$CHANGED_PO_FILES" | |
- name: Powrap | |
if: steps.po-files-to-check.outputs.any_po_files_to_check == 'true' | |
run: powrap --check --quiet ${{ steps.po-files-to-check.outputs.po_files_to_check }} | |
- name: Pospell | |
if: steps.po-files-to-check.outputs.any_po_files_to_check == 'true' | |
run: python scripts/check_spelling.py ${{ steps.po-files-to-check.outputs.po_files_to_check }} |