Skip to content

Commit

Permalink
Remove outdated Ubuntu18.04 jobs, Bump actions/checkout from 1.2.0 to…
Browse files Browse the repository at this point in the history
… 4.1.1

* Bump actions/checkout from 1.2.0 to 4.1.1

Bumps [actions/checkout](https://github.com/actions/checkout) from 1.2.0 to 4.1.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v1.2.0...b4ffde6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Remove outdated Ubuntu18.04 jobs
Bump map dependency
Switch to clang-format-14

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: berndgassmann <bernd.gassmann@intel.com>
  • Loading branch information
dependabot[bot] and berndgassmann authored Jan 31, 2024
1 parent e6938e0 commit 8b763b1
Show file tree
Hide file tree
Showing 13 changed files with 170 additions and 192 deletions.
156 changes: 34 additions & 122 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Test of AD-RSS Library
name: Test

on:
push:
Expand All @@ -14,91 +14,48 @@ permissions:
contents: read

jobs:
ubuntu18job:
name: Ubuntu 18.04
runs-on: ubuntu-latest

strategy:
matrix:
include:
- compiler: gcc7
EXTRA_PACKAGES: ""
CC: ""
CXX: ""
PYTHON_BINDING_VERSION: "2.7"
- compiler: gcc8
EXTRA_PACKAGES: g++-8
CC: /usr/bin/gcc-8
CXX: /usr/bin/g++-8
PYTHON_BINDING_VERSION: "3.6 -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3.6"
- compiler: clang7
EXTRA_PACKAGES: clang-7
CC: /usr/bin/clang-7
CXX: /usr/bin/clang++-7
PYTHON_BINDING_VERSION: "3.6 -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3.6"
- compiler: clang8
EXTRA_PACKAGES: clang-8
CC: /usr/bin/clang-8
CXX: /usr/bin/clang++-8
PYTHON_BINDING_VERSION: "3.6 -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3.6"

container:
image: ubuntu:18.04

steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit

- name: Install base packages
run: apt update && apt install -y git sudo

- uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e # v1.2.0
with:
depth:
submodules: recursive

- name: Install Dependencies
run: bash .github/workflows/install_dependencies.sh

- name: Build and Test
env:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
EXTRA_PACKAGES: ${{ matrix.EXTRA_PACKAGES }}
PYTHON_BINDING_VERSION: ${{ matrix.PYTHON_BINDING_VERSION }}
run: |
sudo apt-get install -y ${EXTRA_PACKAGES}
rm -rf log build install
eval CC=${CC} CXX=${CXX} ${BUILDCMD}
ubuntu20job:
name: Ubuntu 20.04
runs-on: ubuntu-20.04

build-test:
strategy:
matrix:
include:
- compiler: gcc9
EXTRA_PACKAGES: ""
CC: ""
CXX: ""
PYTHON_BINDING_VERSION: "3.8"
- compiler: clang10
EXTRA_PACKAGES: clang-10
CC: /usr/bin/clang-10
CXX: /usr/bin/clang++-10
PYTHON_BINDING_VERSION: "3.8"
include:
- os: ubuntu-20.04
compiler: gcc9
EXTRA_PACKAGES: ""
CC: ""
CXX: ""
PYTHON_BINDING_VERSION: "3.8"
- os: ubuntu-20.04
compiler: clang10
EXTRA_PACKAGES: clang-10
CC: /usr/bin/clang-10
CXX: /usr/bin/clang++-10
PYTHON_BINDING_VERSION: "3.10"
- os: ubuntu-22.04
compiler: gcc11
EXTRA_PACKAGES: ""
CC: ""
CXX: ""
PYTHON_BINDING_VERSION: "3.10"
- os: ubuntu-22.04
compiler: clang14
EXTRA_PACKAGES: clang-14
CC: /usr/bin/clang-14
CXX: /usr/bin/clang++-14
PYTHON_BINDING_VERSION: "3.10"

name: ${{ matrix.os }}, ${{ matrix.compiler }}, python-${{ matrix.PYTHON_BINDING_VERSION }}
runs-on: ${{ matrix.os }}
env:
PYTHON_BINDING_VERSION: ${{ matrix.PYTHON_BINDING_VERSION }}
EXTRA_PACKAGES: ${{ matrix.EXTRA_PACKAGES }}

steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit

- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: recursive

Expand All @@ -109,52 +66,7 @@ jobs:
env:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
EXTRA_PACKAGES: ${{ matrix.EXTRA_PACKAGES }}
PYTHON_BINDING_VERSION: ${{ matrix.PYTHON_BINDING_VERSION }}
run: |
sudo apt-get install ${EXTRA_PACKAGES}
rm -rf log build install
eval CC=${CC} CXX=${CXX} ${BUILDCMD}
ubuntu22job:
name: Ubuntu 22.04
runs-on: ubuntu-22.04

strategy:
matrix:
include:
- compiler: gcc11
EXTRA_PACKAGES: ""
CC: ""
CXX: ""
PYTHON_BINDING_VERSION: "3.10"
- compiler: clang14
EXTRA_PACKAGES: clang-14
CC: /usr/bin/clang-14
CXX: /usr/bin/clang++-14
PYTHON_BINDING_VERSION: "3.10"

steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit

- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
with:
submodules: recursive

- name: Install Dependencies
run: bash .github/workflows/install_dependencies.sh

- name: Build and Test
env:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
EXTRA_PACKAGES: ${{ matrix.EXTRA_PACKAGES }}
PYTHON_BINDING_VERSION: ${{ matrix.PYTHON_BINDING_VERSION }}
run: |
sudo apt-get install ${EXTRA_PACKAGES}
rm -rf log build install
eval CC=${CC} CXX=${CXX} ${BUILDCMD}
7 changes: 3 additions & 4 deletions .github/workflows/check_documentation.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Test Documentation
name: Documentation

on:
push:
Expand All @@ -12,7 +12,6 @@ permissions:
jobs:
documentationjob:

name: Build and Test Documentation
runs-on: ubuntu-20.04

steps:
Expand All @@ -21,7 +20,7 @@ jobs:
with:
egress-policy: audit

- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
submodules: recursive
Expand All @@ -43,7 +42,7 @@ jobs:
colcon build --event-handlers console_direct+ --executor sequential --packages-up-to ad_rss ad_rss_map_integration --cmake-args -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DBUILD_COVERAGE=ON -DBUILD_APIDOC=ON
colcon test --event-handlers console_direct+ --packages-select ad_rss ad_rss_map_integration
colcon test-result
- name: Code Coverage and CodeCov
run: |
bash .github/workflows/code_coverage.sh
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/code_format_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ jobs:

name: Check Code Formatting

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit

- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: true

- name: Install Dependencies
run: sudo apt-get update && sudo apt-get install clang-format-10
run: sudo apt-get update && sudo apt-get install clang-format-14

- name: Check Formatting
run: failed=0; for file in `find . -path ./dependencies -prune -false -o -iname *.cpp -o -iname *.hpp`; do if [ `clang-format-10 $file -output-replacements-xml | grep -c "<replacement "` -ne 0 ]; then echo "$file does not match codeing style. Please run clang-format-10"; failed=1; fi; if [ $failed -ne 0 ]; then exit 1; fi; done
run: failed=0; for file in `find . -path ./dependencies -prune -false -o -iname *.cpp -o -iname *.hpp`; do if [ `clang-format-14 $file -output-replacements-xml | grep -c "<replacement "` -ne 0 ]; then echo "$file does not match codeing style. Please run clang-format-14"; failed=1; fi; if [ $failed -ne 0 ]; then exit 1; fi; done
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
egress-policy: audit

- name: Checkout repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
depth:
submodules: recursive
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ jobs:
egress-policy: audit

- name: 'Checkout Repository'
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: 'Dependency Review'
uses: actions/dependency-review-action@4901385134134e04cec5fbe5ddfe3b2c5bd5d976 # v4.0.0
91 changes: 75 additions & 16 deletions .github/workflows/install_dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,86 @@
#!/bin/bash

python3_pkgs="libpython3-dev python3 python3-pip python3-setuptools python3-wheel"
python2_pkgs="libpython-dev python python-pip python-wheel python-setuptools"
other_pkgs="build-essential castxml cmake libboost-all-dev libgtest-dev liblapacke-dev libopenblas-dev libpugixml-dev sqlite3"

sudo apt-get update
sudo apt-get install -y lsb-core
sudo apt-get install -y --no-install-recommends build-essential castxml cmake libgtest-dev liblapacke-dev libopenblas-dev libpugixml-dev sqlite3

if [ `lsb_release -a | grep Release | grep 18.04 | wc -l` == 1 ]; then
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
IS_PYTHON_3_10=0
echo "!!!!!!! Python version: ${PYTHON_BINDING_VERSION} !!!!!!!"
if [ "${PYTHON_BINDING_VERSION}" == "3.10" ]; then
echo "!!!!!!! Python version is 3.10 detected !!!!!!!"
IS_PYTHON_3_10=1
fi

sudo apt-get update
sudo apt-get install -y --no-install-recommends ${other_pkgs} ${python3_pkgs}

sudo pip3 install --upgrade setuptools==51.1.2
sudo pip3 install colcon-common-extensions xmlrunner pygccxml pyplusplus
IS_UBUNTU_20_04=0
if [ `lsb_release -a | grep Release | grep "20.04" | wc -l` == 1 ]; then
echo "!!!!!!! Ubuntu 20.04: remove python2 !!!!!!!"
sudo apt autoremove python2 python2-dev -y
IS_UBUNTU_20_04=1
if [ "${PYTHON_BINDING_VERSION}" == "" ]; then
echo "!!!!!!! Setting default python version for Ubuntu20.04 !!!!!!!"
IS_PYTHON_3_10=0
PYTHON_BINDING_VERSION="3.8"
fi
elif [ `lsb_release -a | grep Release | grep "22.04" | wc -l` == 1 ]; then
if [ "${PYTHON_BINDING_VERSION}" == "" ]; then
echo "!!!!!!! Setting default python version for Ubuntu22.04 !!!!!!!"
IS_PYTHON_3_10=1
PYTHON_BINDING_VERSION="3.10"
fi
fi

if [ `lsb_release -a | grep Release | grep 18.04 | wc -l` == 1 ]; then
sudo apt-get install -y --no-install-recommends ${python2_pkgs}
sudo pip2 install --upgrade setuptools==41.1.0
sudo pip2 install pygccxml==2.2.1 pyplusplus==1.8.4 xmlrunner
if (( IS_UBUNTU_20_04 && IS_PYTHON_3_10 )); then
echo "!!!!!!! Ubunut 20.04 and python 3.10: install python 3.10 and remove boost !!!!!!!"
sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt-get update
sudo apt-get install -y --no-install-recommends python${PYTHON_BINDING_VERSION}-full
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.10 10
sudo apt autoremove libboost-all-dev -y
else
sudo apt-get install -y --no-install-recommends "python-is-python3"
echo "!!!!!!! Not Ubuntu 20.04 or not python 3.10: install python${PYTHON_BINDING_VERSION} and boost !!!!!!!"
sudo apt-get install -y --no-install-recommends python${PYTHON_BINDING_VERSION}
sudo apt-get install -y --no-install-recommends libboost-all-dev
fi

sudo apt-get install -y --no-install-recommends python${PYTHON_BINDING_VERSION}-dev libpython${PYTHON_BINDING_VERSION}-dev
curl -sS https://bootstrap.pypa.io/get-pip.py | sudo python${PYTHON_BINDING_VERSION}

# to handle some error on missing pip dependencies
sudo pip${PYTHON_BINDING_VERSION} install testresources
sudo pip${PYTHON_BINDING_VERSION} install --upgrade setuptools==59.6.0
sudo pip${PYTHON_BINDING_VERSION} install colcon-common-extensions xmlrunner pygccxml pyplusplus

if (( IS_UBUNTU_20_04 && IS_PYTHON_3_10 )); then
echo "!!!!!!! Ubunut 20.04 and python 3.10: compile boost 1.80 !!!!!!!"
pushd dependencies

BOOST_VERSION=1.78.0
BOOST_PACKAGE_BASENAME=boost_${BOOST_VERSION//./_}
wget "https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION}/source/${BOOST_PACKAGE_BASENAME}.tar.gz"

tar -xzf ${BOOST_PACKAGE_BASENAME}.tar.gz
pushd ${BOOST_PACKAGE_BASENAME}

py3=`which python3.10`
py3_root=`${py3} -c "import sys; print(sys.prefix)"`
pyv=`$py3 -c "import sys;x='{v[0]}.{v[1]}'.format(v=list(sys.version_info[:2]));sys.stdout.write(x)";`

./bootstrap.sh \
--prefix="/usr" \
--with-libraries=python,filesystem,system,program_options \
--with-python=${py3} --with-python-version=${pyv} --with-python-root=${py3_root}
if (( $? )); then
echo "!!!!!!! boost bootstrap failed !!!!!!!"
cat bootstrap.log
fi

./b2 --prefix="/usr" cxxflags="-fPIC" -j 10 stage release
sudo ./b2 --prefix="/usr" cxxflags="-fPIC" -j 10 install

# ensure our colcon build process ignores boost sources
touch COLCON_IGNORE

popd
popd

fi
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
egress-policy: audit

- name: "Checkout code"
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
persist-credentials: false

Expand Down
Loading

0 comments on commit 8b763b1

Please sign in to comment.