From b30ed753e9f5bdfd29f4ce2aea10a697dfc41d6b Mon Sep 17 00:00:00 2001 From: Sam Arbid Date: Wed, 15 Jan 2025 11:50:20 +0100 Subject: [PATCH] ci: use shared workflow for Python tests --- .github/workflows/tests.yml | 44 +++++-------------------------------- 1 file changed, 6 insertions(+), 38 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e099400..14c7fca 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,6 +3,7 @@ # This file is part of Invenio. # Copyright (C) 2020 CERN. # Copyright (C) 2022 Graz University of Technology. +# Copyright (C) 2025 KTH Royal Institute of Technology. # # 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. @@ -11,9 +12,11 @@ name: CI on: push: - branches: master + branches: + - master pull_request: - branches: master + branches: + - master schedule: # * is a special character in YAML so you have to quote this string - cron: '0 3 * * 6' @@ -26,39 +29,4 @@ on: jobs: Tests: - runs-on: ubuntu-20.04 - strategy: - matrix: - python-version: [3.7, 3.8, 3.9] - requirements-level: [pypi] - env: - EXTRAS: tests - 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" ${{ matrix.requirements-file }} --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 -e .[$EXTRAS] - pip freeze - - - name: Run tests - run: | - ./run-tests.sh + uses: inveniosoftware/workflows/.github/workflows/tests-python.yml@master