/
githubmirror
/
setools
Обзор
Документация
Войти
/
githubmirror
/
setools
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
.github/workflows/tests.yml
109 строк
3 KB
Chris PeBenito
CI: Update userspace build to use the GH action in the userspace repo.
11 июн 2026, 16:27
Не верифицирован
11 июн 2026, 16:27
27170ec
Код
Авторство
О чём код?
name: Test SETools on: [push, pull_request, workflow_dispatch] jobs: build_userspace: uses: ./.github/workflows/build-userspace.yml with: # This should be the minimum version required to run setools: version: "3.9" python-version: "3.10" # Not used in setools, but needed for the userspace build: ruby-version: "3.3" test_setools: needs: build_userspace runs-on: ubuntu-24.04 strategy: matrix: # unit tests python: - "3.10" - "3.11" - "3.12" - "3.13" - "3.14" tox: - "python3" include: # static analysis - {python: '3.11', tox: pep8} - {python: '3.11', tox: lint} - {python: '3.11', tox: mypy} - {python: '3.11', tox: coverage} # install test - {python: '3.11', tox: install} steps: - uses: actions/checkout@v6 - name: Download userspace artifact uses: actions/download-artifact@v7 id: dl-userspace with: name: selinux - name: Unpack userspace artifact shell: bash run: | tar -C "${{ steps.dl-userspace.outputs.download-path }}" -zxvf selinux.tar.gz - name: Build SETools uses: ./.github/actions/build-setools id: build-setools with: python: ${{ matrix.python }} userspace-path: ${{ steps.dl-userspace.outputs.download-path }} - name: Install unit test dependencies shell: bash run: | echo "::group::Update system packages from apt" sudo apt-get update -qq echo "::endgroup::" echo "::group::Install unit test dependencies from apt" sudo apt-get install -qqy \ libegl1 \ libdbus-1-3 \ libopengl0 \ libxcb-cursor0 \ libxcb-icccm4 \ libxcb-image0 \ libxcb-keysyms1 \ libxcb-randr0 \ libxcb-render-util0 \ libxcb-xinerama0 \ libxcb-xinput0 \ libxcb-xfixes0 \ libxkbcommon-x11-0 \ x11-utils \ x11-xserver-utils \ xvfb echo "::endgroup::" # Use pip to ensure the packages go to the configured Python environment echo "::group::Install unit test dependencies from pip" python -m pip install -U --user \ tox echo "::endgroup::" - name: Run unit tests/linting shell: bash run: | python --version sudo ln -s "${{steps.dl-userspace.outputs.download-path}}/usr/bin/checkpolicy" /usr/bin/checkpolicy python -m tox -e ${{ matrix.tox }} env: CPPFLAGS: "-I${{steps.dl-userspace.outputs.download-path}}/usr/include" LD_LIBRARY_PATH: "${{steps.dl-userspace.outputs.download-path}}/lib:${{steps.dl-userspace.outputs.download-path}}/usr/lib:${LD_LIBRARY_PATH}" LDFLAGS: "-L${{steps.dl-userspace.outputs.download-path}}/lib -L${{steps.dl-userspace.outputs.download-path}}/usr/lib" - name: Upload failed build directory artifact if: ${{ failure() && runner.debug }} uses: actions/upload-artifact@v7 with: name: failed-setools path: | ${{ github.workspace }}