Skip to content

Commit

Permalink
Update gh actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
moshi4 committed Sep 8, 2024
1 parent 4d130c6 commit bdc90eb
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 38 deletions.
31 changes: 14 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,26 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Python ${{ matrix.python-version}}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
- name: Install Rye
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install Dependencies
run: poetry install -n
curl -sSf https://rye.astral.sh/get | RYE_INSTALL_OPTION="--yes" bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
- name: Run black format check
run: poetry run black src tests --check --diff --verbose
- name: Setup Python ${{matrix.python-version}} & Dependencies
run: |
rye pin ${{ matrix.python-version }}
rye sync --update-all --all-features
- name: Run ruff lint check
run: poetry run ruff .
run: rye run ruff check --diff

- name: Run ruff format check
run: rye run ruff format --check --diff

- name: Run pytest
run: poetry run pytest tests --tb=line --cov=src --cov-report=xml --cov-report=term
run: rye run pytest
18 changes: 8 additions & 10 deletions .github/workflows/publish_mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install MkDocs & Plugins
- name: Install Rye
run: |
pip install .
pip install mkdocs mkdocs-material mkdocs-jupyter mkdocstrings[python] black
curl -sSf https://rye.astral.sh/get | RYE_INSTALL_OPTION="--yes" bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
- name: Install Python & MkDocs & Plugins
run: rye sync

- name: Publish document
run: mkdocs gh-deploy --force
run: rye run mkdocs gh-deploy --force
17 changes: 6 additions & 11 deletions .github/workflows/publish_to_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,15 @@ jobs:
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install Poetry
- name: Install Rye
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
curl -sSf https://rye.astral.sh/get | RYE_INSTALL_OPTION="--yes" bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
- name: Build
run: poetry build
run: rye build

- name: Publish
run: poetry publish -u $PYPI_USERNAME -p $PYPI_PASSWORD
run: rye publish -u $PYPI_USERNAME --token $PYPI_PASSWORD -y

0 comments on commit bdc90eb

Please sign in to comment.