Skip to content

Commit

Permalink
tests: move to reusable workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
utnapischtim committed Sep 26, 2024
1 parent 1e59509 commit 4e30381
Showing 1 changed file with 11 additions and 42 deletions.
53 changes: 11 additions & 42 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,21 @@ name: CI

on:
push:
branches: master
branches:
- master
pull_request:
branches: master
branches:
- master
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]
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: |
python -m pip install --upgrade pip setuptools py 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 ".[$EXTRAS]"
pip freeze
- name: Run tests
run: |
./run-tests.sh
Python:
uses: inveniosoftware/workflows/.github/workflows/tests-python.yml@master
with:
db-service: '[""]'
search-service: '[""]'

0 comments on commit 4e30381

Please sign in to comment.