Skip to content

Commit

Permalink
Renamed pre-commit cfg file
Browse files Browse the repository at this point in the history
  • Loading branch information
atomprobe-tc committed Jul 31, 2024
1 parent 005b9ae commit 9a70539
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 26 deletions.
30 changes: 22 additions & 8 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,41 @@
name: build_docs
on:
push:
branches: [main]
branches:
- main # Triggers deployment on push to the main branch

env:
UV_SYSTEM_PYTHON: true
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout Repository
uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
python-version: '3.x'

- name: Cache mkdocs-material enviroment
uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install ".[docs]"
- run: mkdocs gh-deploy --force
- name: Install Dependencies
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv pip install ".[docs]"
- name: Build and Deploy
run: |
mkdocs gh-deploy --force --remote-branch gh-pages
37 changes: 26 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,45 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Upload Python Package

on: workflow_dispatch
# release:
# types: [published]
env:
UV_SYSTEM_PYTHON: true

jobs:
deploy:
name: Upload release to PyPI
runs-on: ubuntu-latest

environment:
name: pypi
url: https://pypi.org/p/pynxtools-em
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
# submodules: recursive
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
curl -LsSf https://astral.sh/uv/install.sh | sh
uv pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# 27b31702a0e7fc50959f5ad993c78deac1bdfc29
# with:
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}
14 changes: 8 additions & 6 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,28 @@ name: linting

on: [push]

env:
UV_SYSTEM_PYTHON: true
jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
git submodule sync --recursive
git submodule update --init --recursive --jobs=4
python -m pip install --upgrade pip
curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install package
run: |
python -m pip install --no-deps .
- name: Install requirements
uv pip install --no-deps .
- name: Install dev requirements
run: |
python -m pip install -r dev-requirements.txt
uv pip install -r dev-requirements.txt
- name: ruff
run: |
ruff pynxtools_em tests
Expand Down
2 changes: 1 addition & 1 deletion .precommit-config.yaml → .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.3.4
rev: v0.5.5
hooks:
# Run the linter.
- id: ruff
Expand Down

0 comments on commit 9a70539

Please sign in to comment.