mirror of
https://github.com/Cian-H/invenio-config-iform.git
synced 2025-12-23 13:31:58 +00:00
FIxed tests workflow and removed automatic publishing
This commit is contained in:
57
.github/workflows/pypi-publish.yml
vendored
57
.github/workflows/pypi-publish.yml
vendored
@@ -1,57 +0,0 @@
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
workflow_call:
|
||||
inputs:
|
||||
translation_directory:
|
||||
description: directory babel translations reside in, passed to pybabel compile --directory=...
|
||||
required: false
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build-n-publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout the code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
enable-cache: false
|
||||
python-version: 3.12
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
uv pip install --python=3.12 babel build
|
||||
|
||||
- name: Compile translations
|
||||
env:
|
||||
# writing input to env-var prevents injection-attacks
|
||||
# this is suggested by github-documentation's section `Security hardening for GitHub Actions`
|
||||
TRANSLATION_DIRECTORY: ${{inputs.translation_directory}}
|
||||
run: |
|
||||
if [[ -f setup.cfg ]] && grep -q "compile_catalog" setup.cfg
|
||||
then
|
||||
uv pip install --python=3.12 setuptools
|
||||
python setup.py compile_catalog
|
||||
elif [[ -n "$TRANSLATION_DIRECTORY" ]]
|
||||
then
|
||||
if [[ ! -d "$TRANSLATION_DIRECTORY" ]]
|
||||
then
|
||||
echo "given translation-directory `$TRANSLATION_DIRECTORY` does not exist"
|
||||
exit 1
|
||||
fi
|
||||
pybabel compile --directory="$TRANSLATION_DIRECTORY" --use-fuzzy
|
||||
fi
|
||||
|
||||
- name: Build package
|
||||
run: |
|
||||
python -m build
|
||||
|
||||
- name: pypi-publish
|
||||
uses: pypa/gh-action-pypi-publish@v1.12.4
|
||||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.pypi_token }}
|
||||
8
.github/workflows/tests.yml
vendored
8
.github/workflows/tests.yml
vendored
@@ -89,15 +89,15 @@ jobs:
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install ".[tests]"
|
||||
uv sync --group tests
|
||||
|
||||
- name: Show configuration
|
||||
run: |
|
||||
pip --version
|
||||
pip list
|
||||
uv --version
|
||||
uv pip list
|
||||
docker --version
|
||||
docker ps
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
./run-tests.sh
|
||||
uv run ./run-tests.sh
|
||||
|
||||
Reference in New Issue
Block a user