Skip to content

Commit b30ed75

Browse files
Samk13slint
authored andcommitted
ci: use shared workflow for Python tests
1 parent 97fe951 commit b30ed75

File tree

1 file changed

+6
-38
lines changed

1 file changed

+6
-38
lines changed

.github/workflows/tests.yml

+6-38
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# This file is part of Invenio.
44
# Copyright (C) 2020 CERN.
55
# Copyright (C) 2022 Graz University of Technology.
6+
# Copyright (C) 2025 KTH Royal Institute of Technology.
67
#
78
# Invenio is free software; you can redistribute it and/or modify it
89
# under the terms of the MIT License; see LICENSE file for more details.
@@ -11,9 +12,11 @@ name: CI
1112

1213
on:
1314
push:
14-
branches: master
15+
branches:
16+
- master
1517
pull_request:
16-
branches: master
18+
branches:
19+
- master
1720
schedule:
1821
# * is a special character in YAML so you have to quote this string
1922
- cron: '0 3 * * 6'
@@ -26,39 +29,4 @@ on:
2629

2730
jobs:
2831
Tests:
29-
runs-on: ubuntu-20.04
30-
strategy:
31-
matrix:
32-
python-version: [3.7, 3.8, 3.9]
33-
requirements-level: [pypi]
34-
env:
35-
EXTRAS: tests
36-
steps:
37-
- name: Checkout
38-
uses: actions/checkout@v2
39-
40-
- name: Set up Python ${{ matrix.python-version }}
41-
uses: actions/setup-python@v2
42-
with:
43-
python-version: ${{ matrix.python-version }}
44-
45-
- name: Generate dependencies
46-
run: |
47-
pip install wheel requirements-builder
48-
requirements-builder -e "$EXTRAS" ${{ matrix.requirements-file }} --level=${{ matrix.requirements-level }} setup.py > .${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt
49-
50-
- name: Cache pip
51-
uses: actions/cache@v2
52-
with:
53-
path: ~/.cache/pip
54-
key: ${{ runner.os }}-pip-${{ hashFiles('.${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt') }}
55-
56-
- name: Install dependencies
57-
run: |
58-
pip install -r .${{matrix.requirements-level}}-${{ matrix.python-version }}-requirements.txt
59-
pip install -e .[$EXTRAS]
60-
pip freeze
61-
62-
- name: Run tests
63-
run: |
64-
./run-tests.sh
32+
uses: inveniosoftware/workflows/.github/workflows/tests-python.yml@master

0 commit comments

Comments
 (0)