Skip to content

Commit

Permalink
Update gh actions workflow for rye
Browse files Browse the repository at this point in the history
  • Loading branch information
moshi4 committed Jul 13, 2024
1 parent 5192cbf commit 943b453
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 28 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,21 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python ${{ matrix.python-version}}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Rye
run: |
curl -sSf https://rye.astral.sh/get | RYE_INSTALL_OPTION="--yes" bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
- name: Install dependencies
run: pip install -e . pytest pytest-cov ruff
- name: Install Python ${{ matrix.python-version }} & dependencies
run: |
rye pin ${{ matrix.python-version }}
rye sync --update-all --all-features
- name: Run ruff lint check
run: ruff check --diff
run: rye run ruff check --diff

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

- name: Run pytest
run: pytest
run: rye run pytest
16 changes: 7 additions & 9 deletions .github/workflows/publish_mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"

- 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
15 changes: 5 additions & 10 deletions .github/workflows/publish_to_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"

- 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 943b453

Please sign in to comment.