From d67d7071e4bc1a626b1ae4618e40d4ea7c9648d8 Mon Sep 17 00:00:00 2001 From: Chris PeBenito Date: Tue, 18 Apr 2023 11:52:44 -0400 Subject: [PATCH] tests.yml: Add package caching. Signed-off-by: Chris PeBenito --- .github/workflows/tests.yml | 10 +++++++++- setup.py | 6 +++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 79a5cd7..8a3bee7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -62,7 +62,15 @@ jobs: sudo python -m pip install -U \ tox - - name: Build toolchain + - name: Cache SELinux userspace + uses: actions/cache@v3 + id: cache-userspace + with: + path: ${{ env.USERSPACE_SRC }} + key: ${{ runner.os }}-selinux-userspace-${{ env.SELINUX_USERSPACE_VERSION }} + + - name: Build SELinux userspace + if: ${{ steps.cache-userspace.outputs.cache-hit != 'true' }} run: | # Download current SELinux userspace tools and libraries git clone https://github.com/SELinuxProject/selinux.git ${USERSPACE_SRC} -b ${SELINUX_USERSPACE_VERSION} diff --git a/setup.py b/setup.py index f8b680d..5d86946 100644 --- a/setup.py +++ b/setup.py @@ -165,5 +165,9 @@ setup(name='setools', # setup also requires libsepol and libselinux # C libraries and headers to compile. setup_requires=['setuptools', 'Cython>=0.27'], - install_requires=['setuptools', 'networkx>=2.0'] + install_requires=['setuptools'], + extras_require={ + "analysis": "networkx>=2.0", + "test": "tox" + } )