From 23f2aaa2ee2fbf3a99eb9846bd1e0ecc8fdd2bc8 Mon Sep 17 00:00:00 2001 From: cswimr Date: Thu, 10 Oct 2024 16:03:50 -0400 Subject: [PATCH] feat(workflow): move to uv --- .forgejo/workflows/workflow.yaml | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/.forgejo/workflows/workflow.yaml b/.forgejo/workflows/workflow.yaml index 3c23538..600988e 100644 --- a/.forgejo/workflows/workflow.yaml +++ b/.forgejo/workflows/workflow.yaml @@ -1,39 +1,46 @@ name: Actions on: push: - branches: - - 'main' pull_request: jobs: - Lint Code (Ruff & Pylint): + lint: + name: Lint Code (Ruff & Pylint) runs-on: docker - container: www.coastalcommits.com/cswimr/actions:seacogs + container: www.coastalcommits.com/cswimr/actions:uv steps: - name: Checkout uses: actions/checkout@v3 + - name: Install python + run: uv python install 3.11 + - name: Install dependencies - run: poetry install --with dev --no-root + 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 --rcfile=.forgejo/workflows/config/.pylintrc $(git ls-files '*.py') - Build Documentation (MkDocs): + docs: + name: Build Documentation (MkDocs) + if: github.event_name == 'push' && github.ref == 'refs/heads/main' runs-on: docker - container: www.coastalcommits.com/cswimr/actions:seacogs + container: www.coastalcommits.com/cswimr/actions:docs steps: - name: Checkout uses: actions/checkout@v3 with: fetch-depth: 0 + - name: Install python + run: uv python install 3.11 + - name: Install dependencies - run: poetry install --with docs --no-root + run: uv sync --no-dev --extra=documentation - name: Set environment variables uses: actions/env@v2 @@ -42,7 +49,7 @@ jobs: run: | export SITE_URL="https://$CI_ACTION_REF_NAME_SLUG.seacogs.coastalcommits.com" export EDIT_URI="src/branch/$CI_ACTION_REF_NAME/.docs" - ./.venv/bin/mkdocs build -v + uv run mkdocs build -v - name: Deploy documentation run: |