Skip to content

Enforce capital/lowercase in rank names and rank variable names #191

Enforce capital/lowercase in rank names and rank variable names

Enforce capital/lowercase in rank names and rank variable names #191

name: Upload Python Package to PyPI
on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types: [created]
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y graphviz
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
- name: Install Python kernel for notebooks
run: |
python -m ipykernel install --user --name python3
- name: Run tests
run: |
python3 -m unittest discover -s tests -p "*.py" -v
build-package:
name: Build package on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: run-tests
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history and tags for setuptools-scm
submodules: recursive # Check out all submodules
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
working-directory: .
env:
PYTHONPATH: ${{ github.workspace }}
run: |
python -m build
- name: Upload distributions
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}
path: dist/*
pypi-publish:
name: Publish package to PyPI
runs-on: ubuntu-latest
needs: build-package
environment:
name: pypi
url: https://pypi.org/p/accelforge
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history and tags for setuptools-scm
submodules: recursive # Check out all submodules
- name: Download all distributions
uses: actions/download-artifact@v4
with:
pattern: dist-*
merge-multiple: true
path: dist
- name: Publish package distributions to PyPI
if: github.event_name != 'pull_request'
uses: pypa/gh-action-pypi-publish@release/v1