-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test each updated file. There are some files and directories excluded from testing. It is specified in review job. Update workflow to install required packages separatelly. Move github scripts to .github directory (to avoid unlicensed files in other locations). Fix requiring gcc when clang is in use (discovered after updating clang review flow). Signed-off-by: Mariusz Tkaczyk <[email protected]>
- Loading branch information
Showing
7 changed files
with
122 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/bash | ||
|
||
# Install gcc | ||
if [ -z "$1" ]; then | ||
sudo apt-get update && sudo apt-get install gcc-$1 g++-$1 | ||
fi | ||
# Install dependencies | ||
sudo apt-get install pkg-config automake autoconf autoconf-archive make libsgutils2-dev \ | ||
libudev-dev libpci-dev check devscripts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: test | ||
on: [pull_request] | ||
env: | ||
cflags: -Werror | ||
permissions: read-all | ||
jobs: | ||
make: | ||
name: Compilation test with gcc | ||
strategy: | ||
matrix: | ||
gcc-version: [7, 8, 9, 10, 11, 12, 13] | ||
runs-on: ubuntu-latest | ||
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 with library disabled' | ||
run: . ./autogen.sh && ./configure CFLAGS=${{ env.cflags }} | ||
- name: 'Make' | ||
run: CC=gcc-${{ matrix.gcc-version }} CXX=g++-${{ matrix.gcc-version }} && V=1 make -j$(nproc) | ||
- 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: CC=gcc-${{ matrix.gcc-version }} CXX=g++-${{ matrix.gcc-version }} && V=1 make -j$(nproc) | ||
- 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-latest | ||
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: [12] | ||
python-version: ["3.7"] | ||
runs-on: ubuntu-latest | ||
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: CC=gcc-${{ matrix.gcc-version }} CXX=g++-${{ matrix.gcc-version }} && V=1 make -j$(nproc) | ||
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters