From 1fa64dd8cc9d19dcc8426d949ad453eb1fc71048 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Thu, 22 Feb 2024 23:49:22 +0000 Subject: [PATCH] Fix tranlation pipeline (#6559) * use default setup action * small change to trigger CI * use enviroment step * define python version * us uv a bit more * clean diff * globally define python version --- .github/actions/setup/action.yaml | 4 ++-- .github/workflows/check_translations.yaml | 18 +++++++----------- .github/workflows/translations.yml | 22 +++++++++------------- 3 files changed, 18 insertions(+), 26 deletions(-) diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml index 926491119b..86aa699b38 100644 --- a/.github/actions/setup/action.yaml +++ b/.github/actions/setup/action.yaml @@ -56,7 +56,7 @@ runs: - name: Install Specific Python Dependencies if: ${{ inputs.pip-dependency }} shell: bash - run: pip3 install ${{ inputs.pip-dependency }} + run: uv pip install ${{ inputs.pip-dependency }} # NPM installs - name: Install node.js ${{ env.node_version }} @@ -82,7 +82,7 @@ runs: - name: Install dev requirements if: ${{ inputs.dev-install == 'true' ||inputs.install == 'true' }} shell: bash - run: pip install -r requirements-dev.txt + run: uv pip install -r requirements-dev.txt - name: Run invoke install if: ${{ inputs.install == 'true' }} shell: bash diff --git a/.github/workflows/check_translations.yaml b/.github/workflows/check_translations.yaml index 37990fa230..315922717a 100644 --- a/.github/workflows/check_translations.yaml +++ b/.github/workflows/check_translations.yaml @@ -8,6 +8,9 @@ on: branches: - l10 +env: + python_version: 3.9 + jobs: check: @@ -21,22 +24,15 @@ jobs: INVENTREE_MEDIA_ROOT: ./media INVENTREE_STATIC_ROOT: ./static INVENTREE_BACKUP_DIR: ./backup - python_version: 3.9 steps: - name: Checkout Code uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # pin@v4.1.1 - - name: Set Up Python ${{ env.python_version }} - uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # pin@v4.7.1 + - name: Environment Setup + uses: ./.github/actions/setup with: - python-version: ${{ env.python_version }} - cache: 'pip' - - name: Install Dependencies - run: | - sudo apt-get update - sudo apt-get install gettext - pip3 install invoke - invoke install + install: true + apt-dependency: gettext - name: Test Translations run: invoke translate - name: Check Migration Files diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml index 16e0721dba..600d5d22c2 100644 --- a/.github/workflows/translations.yml +++ b/.github/workflows/translations.yml @@ -5,6 +5,10 @@ on: branches: - master +env: + python_version: 3.9 + node_version: 16 + jobs: build: @@ -22,20 +26,12 @@ jobs: steps: - name: Checkout Code uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # pin@v4.1.1 - - name: Set up Python 3.9 - uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # pin@v4.7.1 + - name: Environment Setup + uses: ./.github/actions/setup with: - python-version: 3.9 - - name: Set up Node 16 - uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # pin to v3.8.2 - with: - node-version: 16 - - name: Install Dependencies - run: | - sudo apt-get update - sudo apt-get install -y gettext - pip3 install invoke - invoke install + install: true + npm: true + apt-dependency: gettext - name: Make Translations run: invoke translate - name: Commit files