Skip to content

Commit

Permalink
cicd: add actions
Browse files Browse the repository at this point in the history
  • Loading branch information
dynobo committed Jun 24, 2024
1 parent eb761bf commit 1b3c9f3
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Test
on: [push, pull_request]

concurrency:
group: cicd-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install '.[dev]'
- name: Format
run: ruff format --check .
- name: Lint
run: ruff check .
- name: Type
run: mypy --version
- name: Type
run: mypy -v
- name: Test
run: pytest

publish:
name: Build & Publish
needs: test
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
# Used to authenticate to PyPI via OIDC.
# Used to sign the release's artifacts with sigstore-python.
id-token: write
# Used to attach signing artifacts to the published release.
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install build deps
run: pip install --upgrade build
- name: Build Python package
run: python -m build
- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
print-hash: true
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ classifiers = [
]
dependencies = ["matplotlib", "numpy", "scipy", "statsmodels"]
optional-dependencies = { dev = [
"build",
"linearmodels",
"mypy",
"notebook",
Expand Down

0 comments on commit 1b3c9f3

Please sign in to comment.