Skip to content

Commit

Permalink
🏢 We're in business on nix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
daquintero committed Oct 19, 2024
1 parent 607986b commit 96be43f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}%'
Expand All @@ -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"
4 changes: 4 additions & 0 deletions .github/workflows/nix_environment_testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
16 changes: 12 additions & 4 deletions docs/sections/environment/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/daquintero/piel/blob/develop/.github/workflows/nix_environment_testing.yaml>`_ 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
Expand Down
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
'';
};
};
Expand Down

0 comments on commit 96be43f

Please sign in to comment.