Skip to content

Commit

Permalink
Merge pull request #65 from JohnPaton/workflow
Browse files Browse the repository at this point in the history
CI: use official uv action, fix dynamic package versioning
  • Loading branch information
avaldebe authored Dec 4, 2024
2 parents 4262da7 + 2c1941f commit b4bd61f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 23 deletions.
22 changes: 6 additions & 16 deletions .github/actions/setup-project/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,24 @@ inputs:
python-version:
description: 'Python version to run on'
required: false
default: '3.x'
default: '3.13'
allow-python-prereleases:
description: 'Allow Python prereleases'
required: false
default: false
runs:
using: "composite"
steps:
# https://docs.astral.sh/uv/guides/integration/github/#installation
- name: Install uv
shell: bash
# Install latest uv version using the installer
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
allow-prereleases: ${{ inputs.allow-python-prereleases }}
- name: Configure uv cache
shell: bash
run: echo 'UV_CACHE_DIR=/tmp/.uv-cache' >> $GITHUB_ENV
- name: Restore uv cache
uses: actions/cache@v4
# https://docs.astral.sh/uv/guides/integration/github/#using-uv-in-github-actions
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
path: /tmp/.uv-cache
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}-${{ inputs.python-version }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}-${{ inputs.python-version }}
uv-${{ runner.os }}
python-version: ${{ inputs.python-version }}
enable-cache: true
- name: Install airbase
continue-on-error: ${{ inputs.allow-python-prereleases }}
shell: bash
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ jobs:
- name: Run unit tests
continue-on-error: ${{ matrix.prerelease }}
run: uv run pytest -lk "not integration" --cov
- name: Minimize uv cache
run: uv cache prune --ci

integration-test:
needs: unit-test
Expand All @@ -36,8 +34,6 @@ jobs:
- uses: ./.github/actions/setup-project
name: Setup project
- run: uv run pytest -lvk "integration"
- name: Minimize uv cache
run: uv cache prune --ci

lint:
runs-on: ubuntu-latest
Expand All @@ -54,10 +50,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0
- uses: ./.github/actions/setup-project
name: Setup project
- run: |
uvx --from build pyproject-build --installer uv
uv build
- uses: pypa/gh-action-pypi-publish@release/v1
if: |
github.repository == 'JohnPaton/airbase' &&
Expand All @@ -67,5 +66,3 @@ jobs:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
skip_existing: true
- name: Minimize uv cache
run: uv cache prune --ci

0 comments on commit b4bd61f

Please sign in to comment.