build: switch to uv + add a nix flake
This commit is contained in:
parent
d3511baea3
commit
3e67f627e5
8 changed files with 1248 additions and 65 deletions
|
@ -1,20 +1,29 @@
|
|||
name: Actions
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
Build:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: docker
|
||||
container: www.coastalcommits.com/seaswimmerthefsh/actionscontainers-seacogs:latest
|
||||
container: www.coastalcommits.com/cswimr/actions:uv
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- name: Install python
|
||||
run: uv python install 3.11
|
||||
|
||||
- name: Install dependencies
|
||||
run: python3 -m venv .venv && ./.venv/bin/pip install -r ./requirements.txt
|
||||
run: uv sync --no-dev
|
||||
|
||||
- name: Build the package
|
||||
run: ./.venv/bin/python -m build
|
||||
run: uv build
|
||||
|
||||
- name: Upload the package
|
||||
uses: actions/upload-artifact@v3
|
||||
|
@ -30,25 +39,32 @@ jobs:
|
|||
password: ${{ secrets.COASTALCOMMITSTOKEN }}
|
||||
repository_url: https://www.coastalcommits.com/api/packages/${{ github.repository_owner }}/pypi
|
||||
|
||||
# - name: Publish to PyPi
|
||||
# if: startsWith(github.ref, 'refs/tags/')
|
||||
# uses: actions/pypi-publish@v1.8.14
|
||||
# with:
|
||||
# password: ${{ secrets.PYPI_API_TOKEN }}
|
||||
- name: Publish to PyPi
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
uses: actions/pypi-publish@v1.8.14
|
||||
with:
|
||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
||||
|
||||
Lint Code (Ruff & Pylint):
|
||||
lint:
|
||||
name: Lint with Ruff & Pylint
|
||||
runs-on: docker
|
||||
container: www.coastalcommits.com/seaswimmerthefsh/actionscontainers-seacogs:latest
|
||||
container: www.coastalcommits.com/cswimr/actions:uv
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install python
|
||||
run: uv python install 3.11
|
||||
|
||||
- name: Install dependencies
|
||||
run: python3 -m venv .venv && ./.venv/bin/pip install -r ./requirements.txt
|
||||
run: uv sync
|
||||
|
||||
- name: Analysing code with Ruff
|
||||
run: ./.venv/bin/ruff check $(git ls-files '*.py')
|
||||
run: uv run ruff check $(git ls-files '*.py')
|
||||
continue-on-error: true
|
||||
|
||||
- name: Analysing code with Pylint
|
||||
run: ./.venv/bin/pylint --rcfile=.forgejo/workflows/config/.pylintrc $(git ls-files '*.py')
|
||||
run: uv run pylint $(git ls-files '*.py')
|
||||
continue-on-error: true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue