From 86a0a3bdbebbde81e17df687bc4d7303d27d490f Mon Sep 17 00:00:00 2001 From: Corey Oordt Date: Sat, 14 Dec 2024 16:58:05 -0600 Subject: [PATCH] Fixed GitHub workflows --- .github/actions/release/action.yaml | 9 --------- .github/actions/setup-python-and-git/action.yaml | 12 +++++++----- .github/workflows/docs-final.yml | 11 +++++------ .github/workflows/docs-preview.yml | 11 +++++------ .github/workflows/release.yaml | 2 -- .github/workflows/test.yaml | 6 ++++-- 6 files changed, 21 insertions(+), 30 deletions(-) diff --git a/.github/actions/release/action.yaml b/.github/actions/release/action.yaml index 649bb600..bde34d9d 100644 --- a/.github/actions/release/action.yaml +++ b/.github/actions/release/action.yaml @@ -1,15 +1,9 @@ name: Release description: Create a GitHub release and upload the package to PyPI inputs: - pypi-api-token: - description: 'PyPI API token' - required: true tag-name: description: 'The name of the tag for the GitHub release' required: true - github-token: - description: 'GitHub token' - required: true runs: using: "composite" @@ -31,9 +25,6 @@ runs: files: dist/* tag_name: "${{ inputs.tag-name }}" body_path: release-notes.md - token: ${{ inputs.github-token }} - name: Upload package to PyPI uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ inputs.pypi-api-token }} diff --git a/.github/actions/setup-python-and-git/action.yaml b/.github/actions/setup-python-and-git/action.yaml index 2471ab09..bb288ddb 100644 --- a/.github/actions/setup-python-and-git/action.yaml +++ b/.github/actions/setup-python-and-git/action.yaml @@ -4,19 +4,21 @@ inputs: python-version: description: 'Python version to use' required: false - default: '3.11' + default: '3.12' runs: using: 'composite' steps: - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 name: Setup Python with: python-version: ${{ inputs.python-version }} - cache: 'pip' # caching pip dependencies - + - name: Install the latest version of uv + uses: astral-sh/setup-uv@v4 + with: + version: "latest" - name: Git check run: | - git config --global user.email "bump-my-version@github.actions" + git config --global user.email "action@github.actions" git config --global user.name "Testing Git" git --version git config --list diff --git a/.github/workflows/docs-final.yml b/.github/workflows/docs-final.yml index 1c60edd6..87e24d80 100644 --- a/.github/workflows/docs-final.yml +++ b/.github/workflows/docs-final.yml @@ -19,18 +19,17 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - token: ${{ secrets.PAT }} - - name: Set up Python 3.10 - uses: actions/setup-python@v5 + - name: Setup Python and Git + uses: ./.github/actions/setup-python-and-git with: - python-version: "3.10" + python-version: '3.12' - name: Install dependencies run: | git pull --all - python -m pip install ".[docs]" + uv sync -p 3.12 --group docs - name: Build and deploy documentation run: | - mkdocs gh-deploy --strict -v + uv run mkdocs gh-deploy --strict diff --git a/.github/workflows/docs-preview.yml b/.github/workflows/docs-preview.yml index f2d30a05..18bbc2db 100644 --- a/.github/workflows/docs-preview.yml +++ b/.github/workflows/docs-preview.yml @@ -24,18 +24,17 @@ jobs: with: fetch-depth: 0 - - name: Set up Python 3.10 - uses: actions/setup-python@v5 + - name: Setup Python and Git + uses: ./.github/actions/setup-python-and-git with: - python-version: "3.10" + python-version: '3.12' - name: Install dependencies - run: | - python -m pip install ".[docs]" + run: uv sync -p 3.12 --group docs - name: Build documentation run: | - mkdocs build --strict -v + uv run mkdocs build --strict - name: Deploy preview uses: rossjrw/pr-preview-action@v1 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6df25b25..47c268cf 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -96,5 +96,3 @@ jobs: uses: ./.github/actions/release with: tag-name: ${{ env.TAG_NAME }} - github-token: ${{ secrets.PAT }} - pypi-api-token: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ccbd2376..7ca1d00a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -42,8 +42,10 @@ jobs: run: | echo -e '[ui]\nusername = Testing Mercurial' > ~/.hgrc hg --version - - name: Install test dependencies - run: pip install '.[test]' + - name: Install requirements + shell: bash + run: | + uv sync -p 3.12 --group dev - name: Test run: pytest --cov-report=xml - name: Upload coverage to Codecov