generated from seqan/library-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #201 from eseiler/package_test
[INFRA] Use containers for CI
- Loading branch information
Showing
18 changed files
with
170 additions
and
315 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
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 |
---|---|---|
|
@@ -26,90 +26,68 @@ defaults: | |
|
||
jobs: | ||
build: | ||
name: ${{ matrix.name }} | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 120 | ||
runs-on: ubuntu-latest | ||
name: ${{ matrix.compiler }} | ||
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' || github.event.label.name == 'lint' | ||
strategy: | ||
fail-fast: true | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- name: "gcc13" | ||
compiler: "gcc-13" | ||
build: coverage | ||
build_type: Coverage | ||
|
||
compiler: ["gcc-14"] | ||
container: | ||
image: ghcr.io/seqan/${{ matrix.compiler }} | ||
volumes: | ||
- /home/runner:/home/runner | ||
steps: | ||
# How many commits do we need to fetch to also fetch the branch point? | ||
- name: Get fetch depth | ||
id: fetch_depth | ||
run: echo "depth=$(( ${{ github.event.pull_request.commits }} + 2 ))" >> $GITHUB_OUTPUT | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: ${{ steps.fetch_depth.outputs.depth }} | ||
submodules: false | ||
fetch-depth: 0 | ||
|
||
- name: Setup toolchain | ||
uses: seqan/actions/setup-toolchain@main | ||
- name: Load ccache | ||
uses: actions/cache@v4 | ||
with: | ||
compiler: ${{ matrix.compiler }} | ||
ccache_size: 525M | ||
|
||
- name: Install CMake | ||
uses: seqan/actions/setup-cmake@main | ||
with: | ||
cmake: 3.18.6 | ||
|
||
- name: Install gcovr | ||
run: | | ||
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/${CC/gcc/gcov} 100 | ||
pip install gcovr==6.0 | ||
path: /home/runner/.ccache | ||
save-always: true | ||
key: ccache-${{ runner.os }}-${{ github.workflow }}-${{ matrix.compiler }}-${{ github.ref }} | ||
|
||
- name: Configure tests | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake ../test/${{ matrix.build }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | ||
-DHIBF_VERBOSE_TESTS=OFF | ||
make -j2 gtest_main | ||
cmake ../test/coverage -DCMAKE_BUILD_TYPE=Coverage | ||
make -j gtest_main | ||
- name: Build tests | ||
env: | ||
CCACHE_IGNOREOPTIONS: "-fprofile-abs-path" | ||
working-directory: build | ||
run: | | ||
ccache -z | ||
cd build | ||
make -k -j2 | ||
make -k -j | ||
ccache -sv | ||
- name: Run tests | ||
run: | | ||
cd build | ||
ctest . -j2 --output-on-failure | ||
working-directory: build | ||
run: ctest . -j --output-on-failure | ||
|
||
- name: Generate coverage report | ||
run: | | ||
gcovr --gcov-executable ${{ github.workspace }}/.github/workflows/scripts/gcov.sh \ | ||
--root ${{ github.workspace }}/test/coverage \ | ||
${{ github.workspace }}/build \ | ||
--filter ${{ github.workspace }}/include \ | ||
--filter ${{ github.workspace }}/test/include \ | ||
--filter ${{ github.workspace }}/src \ | ||
--exclude ${{ github.workspace }}/include/hibf/contrib \ | ||
--exclude ${{ github.workspace }}/test/include/hibf/test/iterator_test_template.hpp \ | ||
gcovr --root ${GITHUB_WORKSPACE}/test/coverage \ | ||
${GITHUB_WORKSPACE}/build \ | ||
--filter ${GITHUB_WORKSPACE}/include \ | ||
--filter ${GITHUB_WORKSPACE}/test/include \ | ||
--filter ${GITHUB_WORKSPACE}/src \ | ||
--exclude ${GITHUB_WORKSPACE}/include/hibf/contrib \ | ||
--exclude ${GITHUB_WORKSPACE}/test/include/hibf/test/iterator_test_template.hpp \ | ||
--exclude-lines-by-pattern '^\s*$' \ | ||
--exclude-lines-by-pattern '^\s*};$' \ | ||
--exclude-unreachable-branches \ | ||
--exclude-throw-branches \ | ||
--exclude-noncode-lines \ | ||
-j 2 \ | ||
--xml \ | ||
--output ${{ github.workspace }}/build/coverage_report.xml | ||
-j \ | ||
--cobertura \ | ||
--output ${GITHUB_WORKSPACE}/build/coverage_report.xml | ||
- name: Submit coverage build | ||
uses: codecov/[email protected] | ||
with: | ||
files: ${{ github.workspace }}/build/coverage_report.xml | ||
files: build/coverage_report.xml | ||
fail_ci_if_error: false |
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 |
---|---|---|
|
@@ -23,77 +23,64 @@ defaults: | |
jobs: | ||
build: | ||
name: IWYU | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 120 | ||
runs-on: ubuntu-latest | ||
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' | ||
container: | ||
image: ghcr.io/seqan/clang-18 | ||
volumes: | ||
- /home/runner:/home/runner | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
submodules: false | ||
path: hibf | ||
token: ${{ secrets.SEQAN_ACTIONS_PAT }} | ||
|
||
- name: Setup toolchain | ||
uses: seqan/actions/setup-toolchain@main | ||
with: | ||
compiler: clang-17 | ||
ccache_size: 75M | ||
|
||
- name: Build IWYU | ||
run: | | ||
mkdir iwyu | ||
cd iwyu | ||
git clone https://github.com/include-what-you-use/include-what-you-use.git --branch 0.21 | ||
mkdir build | ||
cd build | ||
mkdir iwyu && cd iwyu | ||
git clone https://github.com/include-what-you-use/include-what-you-use.git --branch 0.22 | ||
mkdir build && cd build | ||
cmake ../include-what-you-use -G "Unix Makefiles" \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_INSTALL_PREFIX=/usr \ | ||
-DCMAKE_PREFIX_PATH=/usr/lib/llvm-17 \ | ||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | ||
-DCMAKE_C_COMPILER_LAUNCHER=ccache | ||
make -j2 | ||
sudo make install | ||
-DCMAKE_PREFIX_PATH=/usr/lib/llvm-18 | ||
make -j | ||
make install | ||
- name: Configure Test | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake ../hibf/test/iwyu -DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_CXX_FLAGS="-stdlib=libc++" \ | ||
-DHIBF_VERBOSE_TESTS=OFF | ||
mkdir build && cd build | ||
cmake ../hibf/test/iwyu -DCMAKE_BUILD_TYPE=Release | ||
- name: Run Test | ||
working-directory: build | ||
run: | | ||
ccache -z | ||
cd build | ||
make -j2 2> out.txt | ||
make -j 2> out.txt | ||
ccache -sv | ||
- name: Apply changes | ||
working-directory: build | ||
run: | | ||
fix_includes.py --nosafe_headers \ | ||
--comments \ | ||
--noreorder \ | ||
--ignore_re ".*/include/hibf/contrib/.*" < build/out.txt | ||
--ignore_re ".*/include/hibf/contrib/.*" < out.txt | ||
- name: Add changes | ||
id: changed_files | ||
working-directory: hibf | ||
run: | | ||
cd hibf | ||
git add . | ||
CPP_LIST=$(git diff --name-only HEAD | { grep -E "(\.cpp|\.hpp)$" || test $? = 1; } | xargs) | ||
echo "cpp_list=$CPP_LIST" >> $GITHUB_OUTPUT | ||
- name: Run clang-format | ||
if: ${{ steps.changed_files.outputs.cpp_list }} | ||
working-directory: hibf | ||
run: | | ||
sudo apt-get remove --yes libllvm15* | ||
install clang-format-15 | ||
cd hibf | ||
clang-format-15 --style=file -i ${{ steps.changed_files.outputs.cpp_list }} | ||
clang-format-18 --style=file -i ${{ steps.changed_files.outputs.cpp_list }} | ||
git add . | ||
- name: Import GPG key | ||
|
@@ -104,14 +91,14 @@ jobs: | |
passphrase: ${{ secrets.SEQAN_ACTIONS_GPG_PASSPHRASE }} | ||
git_user_signingkey: true | ||
git_commit_gpgsign: true | ||
workdir: ${{ github.workspace }}/hibf | ||
workdir: hibf | ||
|
||
- name: Open PR | ||
if: ${{ steps.changed_files.outputs.cpp_list }} | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
token: ${{ secrets.SEQAN_ACTIONS_PAT }} | ||
path: ${{ github.workspace }}/hibf | ||
path: hibf | ||
commit-message: "[MISC] IWYU" | ||
committer: "seqan-actions[bot] <[email protected]>" | ||
author: "seqan-actions[bot] <[email protected]>" | ||
|
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
Oops, something went wrong.