diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 35141c3..a56f322 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -42,9 +42,10 @@ runs: run: | # Container might not be Debian-based if ! command -v apt-get &> /dev/null; then exit 0; fi - apt-get update -y - apt-get install -y --no-install-recommends curl - rm -rf /var/lib/apt/lists/* + if ! command -v curl &> /dev/null; then + apt-get update -y + apt-get install -y --no-install-recommends curl + fi - name: Install system dependencies if: inputs.minimal == 'false' @@ -52,7 +53,7 @@ runs: run: | # Container might not be Debian-based if ! command -v apt-get &> /dev/null; then exit 0; fi - apt-get update + [ -d /var/lib/apt/lists/partial ] || apt-get update apt-get install -y --no-install-recommends \ libglu1-mesa \ libglut3.12 \ @@ -61,7 +62,6 @@ runs: libxcursor1 \ libxft2 \ libxinerama1 - rm -rf /var/lib/apt/lists/* - name: Ensure NodeJS shell: bash @@ -69,18 +69,19 @@ runs: if command -v node &> /dev/null; then exit 0; fi # Container is Debian-based (apt) if command -v apt-get &> /dev/null; then - apt-get update -y + [ -d /var/lib/apt/lists/partial ] || apt-get update -y apt-get install -y --no-install-recommends nodejs + rm -rf /var/lib/apt/lists/* fi # Container Fedora-based (dnf) if command -v dnf &> /dev/null; then - dnf makecache - dnf update -y - dnf install -y node + dnf install -y --nodocs nodejs fi # Slim images do not contain NodeJS - uses: astral-sh/setup-uv@v10.1.0 + with: + enable-cache: 'true' # - name: Install uv # shell: bash @@ -99,13 +100,12 @@ runs: if [[ "${{ inputs.minimal }}" != "true" ]]; then # Regression checks needs NRG Gmsh, pre-install it (try GitHub latest release asset first, then GitLab mirrors) - uv pip install --no-cache-dir https://github.com/hopr-framework/PyHOPE/releases/latest/download/gmsh-${GMSH_VERSION}-py3-none-linux_x86_64.whl || \ - uv pip install --no-cache-dir https://gitlab.iag.uni-stuttgart.de/libs/python-gmsh/-/raw/master/gmsh-${GMSH_VERSION}-py3-none-linux_x86_64.whl || \ - uv pip install --no-cache-dir https://piclas.boltzplatz.eu/public-libs/python-gmsh/-/raw/master/gmsh-${GMSH_VERSION}-py3-none-linux_x86_64.whl - uv pip install --no-cache-dir -e . + uv pip install https://github.com/hopr-framework/PyHOPE/releases/latest/download/gmsh-${GMSH_VERSION}-py3-none-linux_x86_64.whl || \ + uv pip install https://gitlab.iag.uni-stuttgart.de/libs/python-gmsh/-/raw/master/gmsh-${GMSH_VERSION}-py3-none-linux_x86_64.whl || \ + uv pip install https://piclas.boltzplatz.eu/public-libs/python-gmsh/-/raw/master/gmsh-${GMSH_VERSION}-py3-none-linux_x86_64.whl + uv pip install -e . fi if [[ "${{ inputs.coverage }}" == "true" ]]; then - uv pip install --no-cache-dir coverage - rm -rf /var/lib/apt/lists/* - fi + uv pip install coverage + fi \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 148a1da..f3df9f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,7 +101,7 @@ jobs: - shell: bash run: | source .venv/bin/activate - uv pip --no-cache-dir install ty + uv pip install ty ty --version ty check --color always --project pyhope pyhope diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6571532..6369949 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,6 +10,7 @@ repos: # Run the linter - id: ruff name: ruff [linter] + args: [--config=pyproject.toml, --preview] # Run the formatter # - id: ruff-format # name: ruff formatter @@ -24,16 +25,14 @@ repos: - id: vulture name: vulture [dead code] - # ty has no official pre-commit hook yet (https://github.com/astral-sh/ty/issues/269). - # Run it as a local hook using the system-installed binary - - repo: local + - repo: https://github.com/astral-sh/ty-pre-commit + # Ty version + rev: v0.0.83 hooks: + # Run the type checker - id: ty name: ty [type checker] - entry: ty check --color always --project pyhope pyhope - language: system - pass_filenames: false - types: [python] + args: [--color=always, --project=pyhope] - repo: https://github.com/gitleaks/gitleaks rev: v8.24.2