Skip to content

Add README to test directory #37

Add README to test directory

Add README to test directory #37

Workflow file for this run

name: test
on: [pull_request]
env:
cflags: -Werror
permissions: read-all
jobs:
make:
# when gcc is not found, it may be needed to update runner version
runs-on: ubuntu-24.04
name: Compilation test with gcc
strategy:
matrix:
# gcc-versions are used to test up to 5 years old
gcc-version: [9, 10, 11, 12, 13, 14]
steps:
- uses: actions/checkout@v4
- name: 'Add ubuntu repositories'
run: .github/configure_apt.sh
- name: 'Install building dependencies'
run: .github/install_debs_compilation.sh ${{ matrix.gcc-version }}
- name: 'Check if gcc was installed correctly'
run: gcc-${{ matrix.gcc-version }} --version
- name: 'Check if g++ was installed correctly'
run: g++-${{ matrix.gcc-version }} --version
- name: 'Generate compiling configurations with library disabled'
run: . ./autogen.sh && ./configure CFLAGS=${{ env.cflags }}
- name: 'Make'
run: V=1 make -j$(nproc) CC=gcc-${{ matrix.gcc-version }} CXX=g++-${{ matrix.gcc-version }}
- name: 'Hardening check: ledmon'
run: hardening-check src/ledmon/ledmon
- name: 'Hardening check: ledctl'
run: hardening-check src/ledctl/ledctl
- name: 'Check public symbol visibility'
run: tests/check_symbol_visibility.sh
- name: "Clean before retest with library enabled"
run: make clean
- name: 'Generate compiling configurations with library enabled'
run: . .github/build_configure.sh ${{ env.cflags }}
- name: 'Make'
run: V=1 make -j$(nproc) CC=gcc-${{ matrix.gcc-version }} CXX=g++-${{ matrix.gcc-version }}
- name: 'Hardening check: ledmon'
run: hardening-check src/ledmon/ledmon
- name: 'Hardening check: ledctl'
run: hardening-check src/ledctl/ledctl
- name: 'Check public symbol visibility'
run: tests/check_symbol_visibility.sh
clangcompile:
name: Compilation test with clang
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: 'Add ubuntu repositories'
run: .github/configure_apt.sh
- name: 'Install building dependencies'
run: .github/install_debs_compilation.sh
- name: 'Install clang'
run: sudo apt-get install clang
- name: 'Generate compiling configurations'
run: .github/build_configure.sh ${{ env.cflags }} clang
- name: 'Make'
run: V=1 make -j$(nproc)
tests:
name: Run tests
strategy:
matrix:
gcc-version: [13]
python-version: ["3.9"]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: 'Add ubuntu repositories'
run: .github/configure_apt.sh
- name: 'Install building dependencies'
run: .github/install_debs_compilation.sh ${{ matrix.gcc-version }}
- name: 'Generate compiling configurations'
run: .github/build_configure.sh ${{ env.cflags }}
- name: 'Make'
run: V=1 make -j$(nproc) CC=gcc-${{ matrix.gcc-version }} CXX=g++-${{ matrix.gcc-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
- name: Run tests using pytest
run: |
# Run only non-hardware dependent tests
pytest --ledctl-binary=src/ledctl/ledctl