From 75e3f3f3f40e6bf38f057fcaeb15898204500992 Mon Sep 17 00:00:00 2001 From: Christoph Ladurner Date: Thu, 12 Dec 2024 11:38:42 +0100 Subject: [PATCH] setup: change to reusable workflows --- .github/workflows/pypi-publish.yml | 24 ++------ .github/workflows/tests-feature.yaml | 82 ---------------------------- 2 files changed, 4 insertions(+), 102 deletions(-) delete mode 100644 .github/workflows/tests-feature.yaml diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index a11ccd3c..46414e5c 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -7,23 +7,7 @@ on: jobs: build-n-publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.7 - 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 - run: | - python setup.py compile_catalog sdist bdist_wheel - - name: Publish - uses: pypa/gh-action-pypi-publish@v1.3.1 - with: - user: __token__ - - password: ${{ secrets.pypi_token }} + uses: inveniosoftware/workflows/.github/workflows/pypi-publish.yml@master + secrets: inherit + with: + babel-compile-catalog: true diff --git a/.github/workflows/tests-feature.yaml b/.github/workflows/tests-feature.yaml deleted file mode 100644 index ed404b04..00000000 --- a/.github/workflows/tests-feature.yaml +++ /dev/null @@ -1,82 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of Invenio. -# Copyright (C) 2022 CERN. -# -# Invenio is free software; you can redistribute it and/or modify it -# under the terms of the MIT License; see LICENSE file for more details. - -name: Feature development CI - -on: - pull_request: - branches: - - "feature/**" - schedule: - # * is a special character in YAML so you have to quote this string - - cron: "0 3 * * 6" - workflow_dispatch: - inputs: - reason: - description: "Reason" - required: false - default: "Manual trigger" - -jobs: - Tests: - runs-on: ubuntu-20.04 - strategy: - matrix: - python-version: [3.8] # for efficiency test only one specific python version - requirements-level: [pypi] - cache-service: [redis] - db-service: [postgresql13] - search-service: [opensearch2,elasticsearch7] - include: - - db-service: postgresql13 - DB_EXTRAS: "postgresql" - - - search-service: opensearch2 - SEARCH_EXTRAS: "opensearch2" - - - search-service: elasticsearch7 - SEARCH_EXTRAS: "elasticsearch7" - - env: - CACHE: ${{ matrix.cache-service }} - DB: ${{ matrix.db-service }} - SEARCH: ${{ matrix.search-service }} - EXTRAS: tests,${{ matrix.SEARCH_EXTRAS }} - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Generate dependencies - run: | - pip install wheel requirements-builder - requirements-builder -e "$EXTRAS" --level=${{ matrix.requirements-level }} setup.py > .${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt - - - name: Cache pip - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('.${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt') }} - - - name: Install dependencies - run: | - - pip install -r .${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt - pip install -r requirements-feature.txt # this file is used only when targeting a feature/* branch - pip install ".[$EXTRAS]" - pip freeze - docker --version - docker-compose --version - - - name: Run tests - run: | - ./run-tests.sh