diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 77392c0..7f26f4a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2020-2024 Graz University of Technology. +# Copyright (C) 2025 I-Form Advanced Manufacturing Research Centre. # # invenio-theme-iform is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see LICENSE file for more @@ -15,14 +15,73 @@ 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: + create-strategy: + runs-on: ubuntu-latest + + outputs: + matrix: ${{ steps.requirements.outputs.matrix }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: requirements + id: requirements + run: | + # Define a simple matrix with your Python version + # Since we're using pyproject.toml with Python 3.12 requirement + echo "matrix={\"include\": [{\"python-version\": \"3.12\"}]}" >> $GITHUB_OUTPUT + + # Print the matrix for debugging + echo "-------------------" + echo "Matrix: {\"include\": [{\"python-version\": \"3.12\"}]}" + echo "-------------------" + tests: - uses: tu-graz-library/.github/.github/workflows/tests.yml@main + needs: create-strategy + runs-on: ubuntu-latest + name: Test (Python ${{matrix.python-version}}) + strategy: + fail-fast: false + matrix: ${{ fromJson(needs.create-strategy.outputs.matrix) }} + + # Simplified environment without service variables + env: + PYTHON_VERSION: ${{ matrix.python-version }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up uv + uses: astral-sh/setup-uv@v6 + with: + python-version: "${{ matrix.python-version }}" + enable-cache: true + cache-dependency-glob: | + pyproject.toml + cache-suffix: ${{ matrix.python-version }} + + - name: Show configuration + run: | + uv --version + uv run python --version + docker --version + docker ps + + - name: Install dependencies + run: | + uv sync --group tests + + - name: Run tests + run: | + uv run test