Skip to content

Commit

Permalink
Fix github actions.
Browse files Browse the repository at this point in the history
  * Update github actions to latest revisions.
  * Explicitly use Ubuntu 24.04 image for github actions.
  * Install libltdl-dev, as this is needed for bootstrapping.
  * Adaptions for lcov-2.0.
  * Add codecov.yml configuration.
  * Disable the use of arc4random_buf.
  * Disable LTO flags.
  * Use environment file instead of set-output command.
  * Allow cascading if-elsif chain for up to 3 in perlcriticrc.
  * Apply selected fixes from perltidy to Perl scripts.
  • Loading branch information
besser82 committed Jan 14, 2025
1 parent 82b8046 commit 1aa95c4
Show file tree
Hide file tree
Showing 13 changed files with 80 additions and 60 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ on:
jobs:
skip_duplicates:
continue-on-error: true
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
# pin to unreleased SHA so we can use 'same_content_newer'
# see https://github.com/fkirc/skip-duplicate-actions/pull/112
uses: fkirc/skip-duplicate-actions@98d1dc89f43a47f8e4fba8e1c1fb8d6c5fc515ee
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: 'same_content_newer'
skip_after_successful_duplicate: 'true'
Expand All @@ -25,7 +25,7 @@ jobs:
needs: skip_duplicates
if: ${{ needs.skip_duplicates.outputs.should_skip != 'true' }}

runs-on: ubuntu-latest
runs-on: ubuntu-24.04

strategy:
fail-fast: false
Expand All @@ -44,6 +44,7 @@ jobs:
- "--enable-obsolete-api --disable-failure-tokens --enable-hashes=descrypt"

env:
ac_cv_func_arc4random_buf: "no"
CC: ${{ matrix.compiler }}
CONFIG_OPTS: ${{ matrix.config_opts }}
CFLAGS: "-O0 -g -fprofile-arcs -ftest-coverage"
Expand All @@ -53,11 +54,11 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install packages
run: |
packages="lcov"
packages="lcov libltdl-dev"
if [ "$CC" = clang ]; then
# need 'llvm' for llvm-cov, as well as clang
packages="$packages clang llvm"
Expand All @@ -73,7 +74,7 @@ jobs:

- name: Cache bootstrap
id: cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
INSTALL
Expand Down Expand Up @@ -109,10 +110,12 @@ jobs:
run: ./build-aux/ci/summarize-coverage coverage.info

- name: Upload coverage data to Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
files: coverage.info
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

- name: Detailed error logs
if: failure()
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ on:
jobs:
skip_duplicates:
continue-on-error: true
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
# pin to unreleased SHA so we can use 'same_content_newer'
# see https://github.com/fkirc/skip-duplicate-actions/pull/112
uses: fkirc/skip-duplicate-actions@98d1dc89f43a47f8e4fba8e1c1fb8d6c5fc515ee
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: 'same_content_newer'
skip_after_successful_duplicate: 'true'
Expand All @@ -27,18 +27,21 @@ jobs:
needs: skip_duplicates
if: ${{ needs.skip_duplicates.outputs.should_skip != 'true' }}

runs-on: ubuntu-latest
runs-on: ubuntu-24.04
permissions:
actions: read
contents: read
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install packages
run: sudo apt-get install libltdl-dev

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
# CodeQL lumps C with C++. Perl is not currently supported.
languages: cpp, python
Expand All @@ -60,7 +63,7 @@ jobs:

- name: Cache bootstrap
id: cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
INSTALL
Expand Down Expand Up @@ -90,7 +93,7 @@ jobs:
make -j${{ env.NPROCS }} test-programs
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2

- name: Detailed error logs
if: failure()
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/config-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ on:
jobs:
skip_duplicates:
continue-on-error: true
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
# pin to unreleased SHA so we can use 'same_content_newer'
# see https://github.com/fkirc/skip-duplicate-actions/pull/112
uses: fkirc/skip-duplicate-actions@98d1dc89f43a47f8e4fba8e1c1fb8d6c5fc515ee
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: 'same_content_newer'
skip_after_successful_duplicate: 'true'
Expand All @@ -25,7 +25,7 @@ jobs:
needs: skip_duplicates
if: ${{ needs.skip_duplicates.outputs.should_skip != 'true' }}

runs-on: ubuntu-latest
runs-on: ubuntu-24.04

strategy:
fail-fast: false
Expand Down Expand Up @@ -76,11 +76,15 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install packages
if: ${{ matrix.compiler == 'clang' }}
run: sudo apt-get install clang
run: |
packages="libltdl-dev"
if [ "$CC" = clang ]; then
packages="$packages clang"
fi
sudo apt-get install $packages
- name: Versions of build tools
id: build-tools
Expand All @@ -91,7 +95,7 @@ jobs:

- name: Cache bootstrap
id: cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
INSTALL
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
Coverity:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

env:
CVT_PROJECT: besser82/libxcrypt
Expand Down Expand Up @@ -57,7 +57,10 @@ jobs:
fi
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install packages
run: sudo apt-get install libltdl-dev

- name: Download Coverity Build Tool
env:
Expand Down Expand Up @@ -92,7 +95,7 @@ jobs:

- name: Cache bootstrap
id: cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
INSTALL
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/distcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ on:
jobs:
skip_duplicates:
# continue-on-error: true # Uncomment once integration is finished
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
# pin to unreleased SHA so we can use 'same_content_newer'
# see https://github.com/fkirc/skip-duplicate-actions/pull/112
uses: fkirc/skip-duplicate-actions@98d1dc89f43a47f8e4fba8e1c1fb8d6c5fc515ee
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: 'same_content_newer'
skip_after_successful_duplicate: 'true'
Expand All @@ -27,7 +25,7 @@ jobs:
needs: skip_duplicates
if: ${{ needs.skip_duplicates.outputs.should_skip != 'true' }}

runs-on: ubuntu-latest
runs-on: ubuntu-24.04

strategy:
fail-fast: false
Expand All @@ -37,7 +35,10 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install packages
run: sudo apt-get install libltdl-dev

# The distcheck build is run with the oldest version of perl we support,
# in order to verify that we still support it.
Expand Down Expand Up @@ -67,7 +68,7 @@ jobs:

- name: Cache bootstrap
id: cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
INSTALL
Expand Down
26 changes: 15 additions & 11 deletions .github/workflows/memcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ on:
jobs:
skip_duplicates:
continue-on-error: true
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
# pin to unreleased SHA so we can use 'same_content_newer'
# see https://github.com/fkirc/skip-duplicate-actions/pull/112
uses: fkirc/skip-duplicate-actions@98d1dc89f43a47f8e4fba8e1c1fb8d6c5fc515ee
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: 'same_content_newer'
skip_after_successful_duplicate: 'true'
Expand All @@ -25,7 +25,7 @@ jobs:
needs: skip_duplicates
if: ${{ needs.skip_duplicates.outputs.should_skip != 'true' }}

runs-on: ubuntu-latest
runs-on: ubuntu-24.04

strategy:
fail-fast: false
Expand All @@ -38,10 +38,10 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install packages
run: sudo apt-get install clang valgrind
run: sudo apt-get install clang libltdl-dev valgrind

- name: Versions of build tools
id: build-tools
Expand All @@ -52,7 +52,7 @@ jobs:

- name: Cache bootstrap
id: cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
INSTALL
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
needs: skip_duplicates
if: ${{ needs.skip_duplicates.outputs.should_skip != 'true' }}

runs-on: ubuntu-latest
runs-on: ubuntu-24.04

strategy:
fail-fast: false
Expand All @@ -106,19 +106,23 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install packages
if: ${{ matrix.compiler == 'clang' }}
run: sudo apt-get install clang
run: |
packages="libltdl-dev"
if [ "$CC" = clang ]; then
packages="$packages clang"
fi
sudo apt-get install $packages
- name: Versions of build tools
id: build-tools
run: ./build-aux/ci/ci-log-dependency-versions

- name: Cache bootstrap
id: cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
INSTALL
Expand Down
1 change: 1 addition & 0 deletions .perlcriticrc
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ perltidyrc = .perltidyrc
[ControlStructures::ProhibitCStyleForLoops]

[ControlStructures::ProhibitCascadingIfElse]
max_elsif = 3

[ControlStructures::ProhibitDeepNests]

Expand Down
2 changes: 1 addition & 1 deletion build-aux/ci/ci-log-dependency-versions
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,5 @@ except ModuleNotFoundError:
done

set fnord; shift # clear $@
echo "::set-output name=autotools-ver::$autotools_ver"
echo "autotools-ver=$autotools_ver" >> $GITHUB_OUTPUT
exit 0
5 changes: 4 additions & 1 deletion build-aux/ci/configure-wrapper
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#!/bin/bash

export DEB_BUILD_MAINT_OPTIONS="${DEB_BUILD_MAINT_OPTIONS:-hardening=+all}"
export DEB_BUILD_MAINT_OPTIONS="${DEB_BUILD_MAINT_OPTIONS:-hardening=+all optimize=-lto}"

export CPPFLAGS="${CPPFLAGS} $(dpkg-buildflags --get CPPFLAGS)"
export CFLAGS="${CFLAGS} $(dpkg-buildflags --get CFLAGS)"
export CXXFLAGS="${CXXFLAGS} $(dpkg-buildflags --get CXXFLAGS)"
export LDFLAGS="${LDFLAGS} $(dpkg-buildflags --get LDFLAGS)"

# Pretend there is no arc4random_buf available on the system.
export ac_cv_func_arc4random_buf=no

$PWD/configure "$@"
8 changes: 4 additions & 4 deletions build-aux/ci/summarize-coverage
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ set -x
# Merge all of the gcov output into one overview file using lcov,
# then prune data for the tests themselves, and for system libraries.

lcov --gcov-tool "$GCOV" --rc lcov_branch_coverage=1 \
lcov --gcov-tool "$GCOV" --rc branch_coverage=1 \
--directory . --output-file "$unpruned" \
--capture

lcov --gcov-tool "$GCOV" --rc lcov_branch_coverage=1 \
--directory . --output-file "$1" \
--remove "$unpruned" '/usr/*' '*test*'
lcov --gcov-tool "$GCOV" --rc branch_coverage=1 \
--directory . --output-file "$1" --ignore-errors unused \
--remove "$unpruned" '/usr/*' '*test*' '*gen-des-tables*'
Loading

0 comments on commit 1aa95c4

Please sign in to comment.