Skip to content

Commit

Permalink
Run release workflow as a check
Browse files Browse the repository at this point in the history
  • Loading branch information
c-randall committed Dec 20, 2024
1 parent e6a590e commit dce9e4b
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 88 deletions.
106 changes: 53 additions & 53 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ name: build-and-test
on:
push:
paths-ignore:
- '*.md'
- 'docs/**'
- 'images/**'
- 'LICENSE'
- 'SUNDIALS_LICENSE'
- '.github/ISSUE_TEMPLATE/**'
- "*.md"
- "docs/**"
- "images/**"
- "LICENSE"
- "SUNDIALS_LICENSE"
- ".github/ISSUE_TEMPLATE/**"

pull_request:
branches: [main]
paths-ignore:
- '*.md'
- 'docs/**'
- 'images/**'
- 'LICENSE'
- 'SUNDIALS_LICENSE'
- '.github/ISSUE_TEMPLATE/**'
- "*.md"
- "docs/**"
- "images/**"
- "LICENSE"
- "SUNDIALS_LICENSE"
- ".github/ISSUE_TEMPLATE/**"

jobs:
lint:
Expand All @@ -29,7 +29,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.13']
python-version: ["3.13"]

defaults:
run:
Expand All @@ -55,51 +55,51 @@ jobs:
flake8 --config .github/linters/.flake8 src
flake8 --config .github/linters/.flake8 tests
test:
name: (Test ${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
# test:
# name: (Test ${{ matrix.python-version }}, ${{ matrix.os }})
# runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [macos-13, macos-latest, windows-latest, ubuntu-latest]
python-version: ['3.9', '3.13']
# strategy:
# fail-fast: false
# matrix:
# os: [macos-13, macos-latest, windows-latest, ubuntu-latest]
# python-version: ["3.9", "3.13"]

defaults:
run:
shell: bash -l {0}
# defaults:
# run:
# shell: bash -l {0}

steps:
- name: Checkout repository
uses: actions/checkout@v4
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4

- name: Setup conda/python
uses: conda-incubator/setup-miniconda@v3
with: # ci_environment.yml specifies sundials version to compile
auto-update-conda: true
miniconda-version: latest
environment-file: environments/ci_environment.yml
python-version: ${{ matrix.python-version }}
activate-environment: sun
channels: conda-forge
conda-remove-defaults: "true"
# - name: Setup conda/python
# uses: conda-incubator/setup-miniconda@v3
# with: # ci_environment.yml specifies sundials version to compile
# auto-update-conda: true
# miniconda-version: latest
# environment-file: environments/ci_environment.yml
# python-version: ${{ matrix.python-version }}
# activate-environment: sun
# channels: conda-forge
# conda-remove-defaults: "true"

- name: Verify environment
run: |
conda info
conda list
# - name: Verify environment
# run: |
# conda info
# conda list

- name: Install scikit-sundae
run: |
python -m pip install --upgrade pip
pip install .
# - name: Install scikit-sundae
# run: |
# python -m pip install --upgrade pip
# pip install .

- name: List info
run: |
conda info
conda list
# - name: List info
# run: |
# conda info
# conda list

- name: Pytest
run: |
pip install pandas pytest
pytest .
# - name: Pytest
# run: |
# pip install pandas pytest
# pytest .
69 changes: 35 additions & 34 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ jobs:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: true
fail-fast: false
matrix:
os: [macos-13, macos-latest, windows-latest, ubuntu-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.9", "3.13"]

defaults:
run:
Expand Down Expand Up @@ -114,7 +114,8 @@ jobs:
echo "DYLD_LIBRARY_PATH=$CONDA_PREFIX/lib" >> $GITHUB_ENV
- name: Build wheels
run: python -m build --wheel
run: |
python -m build --wheel
- name: Repair Windows wheels
if: runner.os == 'Windows'
Expand Down Expand Up @@ -225,34 +226,34 @@ jobs:
name: dist-sdist
path: dist/*.tar.gz

pypi-publish:
name: Upload to PyPI
needs: [build-wheels, build-sdist]
runs-on: ubuntu-latest

steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: dist/
pattern: dist-*
merge-multiple: true

- name: Check files
run: ls dist

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Install twine
run: pip install twine

- name: Check builds and upload to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
twine check dist/*
twine upload dist/*
# pypi-publish:
# name: Upload to PyPI
# needs: [build-wheels, build-sdist]
# runs-on: ubuntu-latest

# steps:
# - name: Download artifacts
# uses: actions/download-artifact@v4
# with:
# path: dist/
# pattern: dist-*
# merge-multiple: true

# - name: Check files
# run: ls dist

# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: "3.13"

# - name: Install twine
# run: pip install twine

# - name: Check builds and upload to PyPI
# env:
# TWINE_USERNAME: __token__
# TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
# run: |
# twine check dist/*
# twine upload dist/*
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# pyproject.toml

[build-system]
requires = ["setuptools", "cython>=3", "numpy"]
requires = ["setuptools", "cython>=3", "numpy<2.2"]
build-backend = "setuptools.build_meta"

[project]
Expand Down

0 comments on commit dce9e4b

Please sign in to comment.