From 6695a0c1eadb89b586d65437cbfe4167befff81e Mon Sep 17 00:00:00 2001 From: Christoph Ladurner Date: Thu, 28 Nov 2024 20:44:56 +0100 Subject: [PATCH] setup: change to reusable workflows --- .github/workflows/pypi-publish.yml | 28 ++----------------- .github/workflows/tests.yml | 44 ++++-------------------------- 2 files changed, 8 insertions(+), 64 deletions(-) diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 2657cbc..d37d460 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -7,29 +7,5 @@ on: jobs: Publish: - runs-on: ubuntu-20.04 - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel babel - - - name: Build package - # Remove `compile_catalog` if the package has no translations. - run: | - python setup.py compile_catalog sdist bdist_wheel - - - name: Publish on PyPI - uses: pypa/gh-action-pypi-publish@v1.3.1 - with: - user: __token__ - # The token is provided by the inveniosoftware organization - password: ${{ secrets.pypi_token }} + uses: inveniosoftware/workflows/.github/workflows/pypi-publish.yml@master + secrets: inherit diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9b40348..86ab456 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,48 +16,16 @@ on: branches: master schedule: # * is a special character in YAML so you have to quote this string - - cron: '0 3 * * 6' + - cron: "0 3 * * 6" workflow_dispatch: inputs: reason: - description: 'Reason' + description: "Reason" required: false - default: 'Manual trigger' + default: "Manual trigger" jobs: Tests: - runs-on: ubuntu-20.04 - strategy: - matrix: - python-version: [3.9, 3.12] - db-service: [postgresql14, mysql8] - include: - - db-service: postgresql14 - DB_EXTRAS: "postgresql" - - - db-service: mysql8 - DB_EXTRAS: "mysql" - - env: - DB: ${{ matrix.db-service }} - EXTRAS: tests - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: pip - cache-dependency-path: setup.cfg - - - name: Install dependencies - run: | - pip install ".[$EXTRAS]" - pip freeze - docker version - - - name: Run tests - run: | - ./run-tests.sh + uses: inveniosoftware/workflows/.github/workflows/tests-python.yml@master + with: + search-service: '[""]'