| 1 |
name: Memory access checking |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
pull_request: |
| 6 |
|
| 7 |
jobs: |
| 8 |
skip_duplicates: |
| 9 |
continue-on-error: true |
| 10 |
runs-on: ubuntu-24.04 |
| 11 |
outputs: |
| 12 |
should_skip: ${{ steps.skip_check.outputs.should_skip }} |
| 13 |
steps: |
| 14 |
- id: skip_check |
| 15 |
uses: fkirc/skip-duplicate-actions@v5 |
| 16 |
with: |
| 17 |
concurrent_skipping: 'same_content_newer' |
| 18 |
skip_after_successful_duplicate: 'true' |
| 19 |
paths_ignore: '["doc/**", "**/*.md", ".gitignore", "libxcrypt.spec.rpkg", ".packit.yaml", "rpkg.macros", "AUTHORS", "ChangeLog", "COPYING.LIB", "LICENSING", "NEWS", "README", "THANKS", "TODO"]' |
| 20 |
do_not_skip: '["workflow_dispatch", "schedule"]' |
| 21 |
|
| 22 |
Valgrind: |
| 23 |
needs: skip_duplicates |
| 24 |
if: ${{ needs.skip_duplicates.outputs.should_skip != 'true' }} |
| 25 |
|
| 26 |
runs-on: ubuntu-24.04 |
| 27 |
|
| 28 |
strategy: |
| 29 |
fail-fast: false |
| 30 |
matrix: |
| 31 |
compiler: [gcc, clang] |
| 32 |
|
| 33 |
env: |
| 34 |
ac_cv_func_arc4random_buf: "no" |
| 35 |
CC: ${{ matrix.compiler }} |
| 36 |
LDFLAGS: "-Wl,--no-undefined-version" |
| 37 |
VERBOSE: 1 |
| 38 |
|
| 39 |
steps: |
| 40 |
- name: Checkout |
| 41 |
uses: actions/checkout@v4 |
| 42 |
|
| 43 |
- name: Install packages |
| 44 |
run: sudo apt-get install clang libltdl-dev valgrind |
| 45 |
|
| 46 |
- name: Versions of build tools |
| 47 |
id: build-tools |
| 48 |
run: ./build-aux/ci/ci-log-dependency-versions |
| 49 |
|
| 50 |
- name: Get nprocs |
| 51 |
run: echo "NPROCS=$((`nproc --all 2>/dev/null || sysctl -n hw.ncpu` * 2))" | tee $GITHUB_ENV |
| 52 |
|
| 53 |
- name: Cache bootstrap |
| 54 |
id: cache |
| 55 |
uses: actions/cache@v4 |
| 56 |
with: |
| 57 |
path: | |
| 58 |
INSTALL |
| 59 |
Makefile.in |
| 60 |
aclocal.m4 |
| 61 |
config.h.in |
| 62 |
configure |
| 63 |
autom4te.cache/** |
| 64 |
build-aux/m4/libtool.m4 |
| 65 |
build-aux/m4/ltoptions.m4 |
| 66 |
build-aux/m4/ltsugar.m4 |
| 67 |
build-aux/m4/ltversion.m4 |
| 68 |
build-aux/m4/lt~obsolete.m4 |
| 69 |
build-aux/m4-autogen/** |
| 70 |
key: autoreconf-${{ steps.build-tools.outputs.autotools-ver }}-${{ hashFiles('autogen.sh', 'configure.ac', 'Makefile.am', 'build-aux/m4/*.m4', 'build-aux/m4-autogen/**') }} |
| 71 |
|
| 72 |
- name: Bootstrap |
| 73 |
if: steps.cache.outputs.cache-hit != 'true' |
| 74 |
run: ./autogen.sh |
| 75 |
|
| 76 |
- name: Configure |
| 77 |
run: ./build-aux/ci/configure-wrapper --enable-obsolete-api --enable-hashes=all --enable-valgrind-memcheck |
| 78 |
|
| 79 |
- name: Build |
| 80 |
run: | |
| 81 |
make -j${{ env.NPROCS }} all |
| 82 |
make -j${{ env.NPROCS }} test-programs |
| 83 |
|
| 84 |
- name: Test |
| 85 |
run: make -j${{ env.NPROCS }} check-valgrind-memcheck |
| 86 |
|
| 87 |
- name: Detailed error logs |
| 88 |
if: failure() |
| 89 |
run: ./build-aux/ci/ci-log-logfiles |
| 90 |
|
| 91 |
ASan-UBSan: |
| 92 |
needs: skip_duplicates |
| 93 |
if: ${{ needs.skip_duplicates.outputs.should_skip != 'true' }} |
| 94 |
|
| 95 |
runs-on: ubuntu-24.04 |
| 96 |
|
| 97 |
strategy: |
| 98 |
fail-fast: false |
| 99 |
matrix: |
| 100 |
compiler: [gcc, clang] |
| 101 |
|
| 102 |
env: |
| 103 |
ac_cv_func_arc4random_buf: "no" |
| 104 |
CC: ${{ matrix.compiler }} |
| 105 |
DEB_BUILD_MAINT_OPTIONS: hardening=+all sanitize=+address,+leak,+undefined |
| 106 |
LDFLAGS: "-Wl,--no-undefined-version" |
| 107 |
VERBOSE: 1 |
| 108 |
|
| 109 |
steps: |
| 110 |
- name: Checkout |
| 111 |
uses: actions/checkout@v4 |
| 112 |
|
| 113 |
- name: Install packages |
| 114 |
run: | |
| 115 |
packages="libltdl-dev" |
| 116 |
if [ "$CC" = clang ]; then |
| 117 |
packages="$packages clang" |
| 118 |
fi |
| 119 |
sudo apt-get install $packages |
| 120 |
|
| 121 |
- name: Versions of build tools |
| 122 |
id: build-tools |
| 123 |
run: ./build-aux/ci/ci-log-dependency-versions |
| 124 |
|
| 125 |
- name: Cache bootstrap |
| 126 |
id: cache |
| 127 |
uses: actions/cache@v4 |
| 128 |
with: |
| 129 |
path: | |
| 130 |
INSTALL |
| 131 |
Makefile.in |
| 132 |
aclocal.m4 |
| 133 |
config.h.in |
| 134 |
configure |
| 135 |
autom4te.cache/** |
| 136 |
build-aux/m4/libtool.m4 |
| 137 |
build-aux/m4/ltoptions.m4 |
| 138 |
build-aux/m4/ltsugar.m4 |
| 139 |
build-aux/m4/ltversion.m4 |
| 140 |
build-aux/m4/lt~obsolete.m4 |
| 141 |
build-aux/m4-autogen/** |
| 142 |
key: autoreconf-${{ steps.build-tools.outputs.autotools-ver }}-${{ hashFiles('autogen.sh', 'configure.ac', 'Makefile.am', 'build-aux/m4/*.m4', 'build-aux/m4-autogen/**') }} |
| 143 |
|
| 144 |
- name: Bootstrap |
| 145 |
if: steps.cache.outputs.cache-hit != 'true' |
| 146 |
run: ./autogen.sh |
| 147 |
|
| 148 |
- name: Configure |
| 149 |
run: ./build-aux/ci/configure-wrapper --enable-obsolete-api --enable-hashes=all |
| 150 |
|
| 151 |
- name: Build |
| 152 |
run: | |
| 153 |
make -j${{ env.NPROCS }} all UNDEF_FLAG= |
| 154 |
make -j${{ env.NPROCS }} test-programs UNDEF_FLAG= |
| 155 |
|
| 156 |
- name: Test |
| 157 |
run: make -j${{ env.NPROCS }} check |
| 158 |
|
| 159 |
- name: Detailed error logs |
| 160 |
if: failure() |
| 161 |
run: ./build-aux/ci/ci-log-logfiles |