name: e2e-cache freethread

on:
  pull_request:
    paths-ignore:
      - '**.md'
  push:
    branches:
      - main
      - releases/*
    paths-ignore:
      - '**.md'
  workflow_dispatch:

permissions:
  contents: read
jobs:
  python-pip-dependencies-caching:
    name: Test pip (Python ${{ matrix.python-version}}, ${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os:
          [
            ubuntu-latest,
            ubuntu-22.04,
            ubuntu-24.04-arm,
            ubuntu-22.04-arm,
            windows-latest,
            macos-latest,
            macos-13
          ]
        python-version: [3.13.0t, 3.13.1t, 3.13.2t]
    steps:
      - uses: actions/checkout@v4
      - name: Setup Python
        uses: ./
        with:
          python-version: ${{ matrix.python-version }}
          cache: 'pip'
      - name: Install dependencies
        run: pip install numpy pandas requests

  python-pipenv-dependencies-caching:
    name: Test pipenv (Python ${{ matrix.python-version}}, ${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os:
          [
            ubuntu-latest,
            ubuntu-24.04-arm,
            ubuntu-22.04,
            ubuntu-22.04-arm,
            windows-latest,
            macos-latest,
            macos-13
          ]
        python-version: [3.13.0t, 3.13.1t, 3.13.2t]
    steps:
      - uses: actions/checkout@v4
      - name: Setup Python
        id: cache-pipenv
        uses: ./
        with:
          python-version: ${{ matrix.python-version }}
          cache: 'pipenv'
      - name: Install pipenv
        run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
      - name: Install dependencies
        run: pipenv install requests

  python-poetry-dependencies-caching:
    name: Test poetry (Python ${{ matrix.python-version}}, ${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os:
          [
            ubuntu-latest,
            ubuntu-22.04,
            ubuntu-24.04-arm,
            ubuntu-22.04-arm,
            windows-latest,
            macos-latest,
            macos-13
          ]
        python-version: [3.13.0, 3.13.1, 3.13.2]
    steps:
      - uses: actions/checkout@v4
      - name: Install poetry
        run: pipx install poetry
      - name: Init pyproject.toml
        run: mv ./__tests__/data/pyproject.toml .
      - name: Setup Python
        uses: ./
        with:
          python-version: ${{ matrix.python-version }}
          freethreaded: true
          cache: 'poetry'
      - name: Install dependencies
        run: poetry install --no-root

  python-pip-dependencies-caching-path:
    name: Test pip (Python ${{ matrix.python-version}}, ${{ matrix.os }}, caching path)
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os:
          [
            ubuntu-latest,
            ubuntu-22.04,
            ubuntu-24.04-arm,
            ubuntu-22.04-arm,
            windows-latest,
            macos-latest,
            macos-13
          ]
        python-version: [3.13.0t, 3.13.1t, 3.13.2t]
    steps:
      - uses: actions/checkout@v4
      - name: Setup Python
        uses: ./
        with:
          python-version: ${{ matrix.python-version }}
          cache: 'pip'
          cache-dependency-path: __tests__/data/requirements.txt
      - name: Install dependencies
        run: pip install numpy pandas requests

  python-pipenv-dependencies-caching-path:
    name: Test pipenv (Python ${{ matrix.python-version}}, ${{ matrix.os }}, caching path)
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os:
          [
            ubuntu-latest,
            ubuntu-22.04,
            ubuntu-24.04-arm,
            ubuntu-22.04-arm,
            windows-latest,
            macos-latest,
            macos-13
          ]
        python-version: [3.13.0t, 3.13.1t, 3.13.2t]
    steps:
      - uses: actions/checkout@v4
      - name: Setup Python
        id: cache-pipenv
        uses: ./
        with:
          python-version: ${{ matrix.python-version }}
          cache: 'pipenv'
          cache-dependency-path: '**/pipenv-requirements.txt'
      - name: Install pipenv
        run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
      - name: Install dependencies
        run: pipenv install requests