diff --git a/.github/workflows/execute_notebook.yaml b/.github/workflows/execute_notebook.yaml index a3d4f842..8a5cf8fa 100644 --- a/.github/workflows/execute_notebook.yaml +++ b/.github/workflows/execute_notebook.yaml @@ -11,46 +11,48 @@ on: branches: - 'master' - 'develop' + create: branches: - 'master' tags: - '**' + jobs: linux: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 if: "!contains(github.event.head_commit.message, 'no ci')" strategy: max-parallel: 5 matrix: - os: [ubuntu-latest] - python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] + python-version: ['3.9', '3.10', '3.11', '3.12'] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + cache: 'pip' - name: Install dependencies run: | python -m pip install --upgrade pip - pip install lxml_html_clean - pip install -r requirements.txt - pip install mosek + python -m pip install lxml_html_clean + python -m pip install -r requirements.txt + python -m pip install mosek - name: Update version in setup.py run: sed -i "s/{{VERSION_PLACEHOLDER}}/0.0.0/g" setup.py - name: Install PEPit - run: pip install -e . + run: python -m pip install -e . - name: Install notebook runner deps (papermill etc.) run: | - pip install papermill ipykernel nbformat nbconvert + python -m pip install papermill ipykernel nbformat nbconvert - name: Run demo notebook with papermill env: diff --git a/.github/workflows/pypi_release.yaml b/.github/workflows/pypi_release.yaml index 922f7c8a..e73f7aee 100644 --- a/.github/workflows/pypi_release.yaml +++ b/.github/workflows/pypi_release.yaml @@ -3,32 +3,40 @@ name: Publish Python 🐍 distributions 📦 to PyPI on: push: tags: - - '*' + - '*' jobs: build-n-publish: name: Build and publish Python 🐍 distributions 📦 to PyPI - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 + steps: - - uses: actions/checkout@master - - name: Set up Python 3.10 - uses: actions/setup-python@v3 - with: - python-version: '3.10' - - name: Install pypa/setuptools - run: >- - python -m - pip install wheel - - name: Extract tag name - id: tag - run: echo ::set-output name=TAG_NAME::$(echo $GITHUB_REF | cut -d / -f 3) - - name: Update version in setup.py - run: >- - sed -i "s/{{VERSION_PLACEHOLDER}}/${{ steps.tag.outputs.TAG_NAME }}/g" setup.py - - name: Build a binary wheel - run: >- - python setup.py sdist bdist_wheel - - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@master - with: - password: ${{ secrets.PYPI_API_TOKEN }} + - uses: actions/checkout@v4 + + - name: Set up Python 3.10 + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: Install build tooling + run: | + python -m pip install --upgrade pip + python -m pip install build + + - name: Extract tag name + id: tag + run: | + echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT + + - name: Update version in setup.py + run: | + sed -i "s/{{VERSION_PLACEHOLDER}}/${{ steps.tag.outputs.TAG_NAME }}/g" setup.py + + - name: Build distributions + run: | + python -m build + + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 1376c02d..d6b68017 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -21,8 +21,7 @@ on: jobs: linux: - - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 if: "!contains(github.event.head_commit.message, 'no ci')" strategy: max-parallel: 5 @@ -30,37 +29,41 @@ jobs: python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - - uses: actions/checkout@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install coverage - - name: Update version in setup.py - run: >- - sed -i "s/{{VERSION_PLACEHOLDER}}/0.0.0/g" setup.py - - name: Install PEPit - run: | - pip install -e . - - name: Install MOSEK - run: | - pip install mosek - - name: Setup MOSEK license, run tests and generate report - env: - MOSEKLM_LICENSE_FILE: ${{ secrets.MSK_LICENSE }} - run: | - coverage run -m unittest tests/test_* - - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v3 + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' - linux_no_mosek: + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -r requirements.txt + python -m pip install coverage + + - name: Update version in setup.py + run: sed -i "s/{{VERSION_PLACEHOLDER}}/0.0.0/g" setup.py + + - name: Install PEPit + run: python -m pip install -e . + + - name: Install MOSEK + run: python -m pip install mosek + + - name: Setup MOSEK license, run tests and generate report + env: + MOSEKLM_LICENSE_FILE: ${{ secrets.MSK_LICENSE }} + run: | + coverage run -m unittest tests/test_* - runs-on: ubuntu-latest + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v3 + + + linux_no_mosek: + runs-on: ubuntu-22.04 if: "!contains(github.event.head_commit.message, 'no ci')" strategy: max-parallel: 5 @@ -68,32 +71,36 @@ jobs: python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - - uses: actions/checkout@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install coverage - - name: Update version in setup.py - run: >- - sed -i "s/{{VERSION_PLACEHOLDER}}/0.0.0/g" setup.py - - name: Install PEPit - run: | - pip install -e . - - name: Run tests and generate report - run: | - coverage run -m unittest tests/test_* - - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v3 + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' - linux_no_mosek_license: + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -r requirements.txt + python -m pip install coverage + + - name: Update version in setup.py + run: sed -i "s/{{VERSION_PLACEHOLDER}}/0.0.0/g" setup.py + + - name: Install PEPit + run: python -m pip install -e . - runs-on: ubuntu-latest + - name: Run tests and generate report + run: | + coverage run -m unittest tests/test_* + + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v3 + + + linux_no_mosek_license: + runs-on: ubuntu-22.04 if: "!contains(github.event.head_commit.message, 'no ci')" strategy: max-parallel: 5 @@ -101,27 +108,32 @@ jobs: python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - - uses: actions/checkout@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install coverage - - name: Update version in setup.py - run: >- - sed -i "s/{{VERSION_PLACEHOLDER}}/0.0.0/g" setup.py - - name: Install PEPit - run: | - pip install -e . - - name: Setup MOSEK - run: | - pip install mosek - - name: Run tests and generate report - run: | - coverage run -m unittest tests/test_* - - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v3 + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -r requirements.txt + python -m pip install coverage + + - name: Update version in setup.py + run: sed -i "s/{{VERSION_PLACEHOLDER}}/0.0.0/g" setup.py + + - name: Install PEPit + run: python -m pip install -e . + + - name: Setup MOSEK + run: python -m pip install mosek + + - name: Run tests and generate report + run: | + coverage run -m unittest tests/test_* + + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v3