From 96be43f3109c9e6b67c29fb238a60182d0d3f0b6 Mon Sep 17 00:00:00 2001 From: daquintero Date: Sat, 19 Oct 2024 11:44:40 +0200 Subject: [PATCH] :office: We're in business on nix CI --- .github/workflows/coverage.yaml | 6 +++--- .github/workflows/nix_environment_testing.yaml | 4 ++++ docs/sections/environment/index.rst | 16 ++++++++++++---- flake.nix | 1 + 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 264dccc3..029def1a 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -53,8 +53,8 @@ jobs: - name: Run tests run: | source venv/bin/activate - uv run coverage run -m pytest -rA tests - uv run coverage report -m + python -m coverage run -m pytest -rA tests + python -m coverage report -m echo "total=$(coverage report --format=total)" >> $GITHUB_ENV echo '### Total coverage: ${{ env.total }}%' @@ -68,7 +68,7 @@ jobs: filename: piel_coverage.json label: Coverage message: ${{ env.total }}% - minColorRange: 60 + minColorRange: 40 maxColorRange: 95 valColorRange: ${{ env.total }} style: "for-the-badge" diff --git a/.github/workflows/nix_environment_testing.yaml b/.github/workflows/nix_environment_testing.yaml index 61c7a445..7bb46684 100644 --- a/.github/workflows/nix_environment_testing.yaml +++ b/.github/workflows/nix_environment_testing.yaml @@ -34,3 +34,7 @@ jobs: # Step 6: Run flake checks/tests - name: Run Flake Checks run: nix flake check + + # Step 6: Run piel tests + - name: Run piel tests + run: nix develop . --command python -m pytest tests/ diff --git a/docs/sections/environment/index.rst b/docs/sections/environment/index.rst index 24cff467..67c545b0 100644 --- a/docs/sections/environment/index.rst +++ b/docs/sections/environment/index.rst @@ -4,17 +4,25 @@ Environment .. include:: tools_environment.rst -``piel CLI`` (Recommended - In Active Development) +``piel CLI`` (Recommended - CI Tested) ======================================================================== -``piel`` is a command line interface (CLI) that is designed to be a simple and easy to use tool for managing the ``piel`` toolchain. It is necessary to first install ``piel`` in a given python environment and then the CLI tool should automatically be active in that envrionment. You then just need to run ``$ piel`` in the terminal to see the available commands. +``piel`` is a command line interface (CLI) that is designed to be a simple and easy to use tool for managing the ``piel`` toolchain. It is necessary to first install ``piel`` in a given python environment and then the CLI tool should automatically be active in that environment. You then just need to run ``$ piel`` in the terminal to see the available commands. .. include:: piel_cli/common_useful_commands.rst -``nix`` Configuration (In Passive Development) +``nix`` Configuration (Recommended - CI Tested) ======================================================================== -If you want to enter the corresponding `nix-shell` environment, you can run the following command which will print the updated command you just need to copy paste into your terminal to activate the `nix-shell` environment. +This is the recommended way to access the entire toolset environment. This will install all the external dependencies such as ``openlane``, ``ngspice``, ``cocotb`` and so on. It can be easily extended in a standard nix-pkgs flow. However, in order to run this flow you need to have nix installed which is feasible in Linux and MacOS. The entire ``piel`` package gets tested in this `nix environment in the CI `_ so it is reproducible to some level. + +If you have ``piel`` cloned locally, all you need to do is: + +.. code-block:: + + nix develop . + +If you want to enter the corresponding `nix-shell` environment which is extensible with further packages, you can run the following command which will print the updated command you just need to copy paste into your terminal to activate the `nix-shell` environment. .. code-block:: bash diff --git a/flake.nix b/flake.nix index 9148c104..62c300b0 100644 --- a/flake.nix +++ b/flake.nix @@ -111,6 +111,7 @@ source .venv/bin/activate # Activate the virtual environment echo "Virtual environment activated. Installing additional packages with pip..." uv pip install -e .[dev] + uv pip install -r requirements_notebooks.txt ''; }; };