-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add local composite action 'linux-setup'
Signed-off-by: Unai Martinez-Corral <[email protected]>
- Loading branch information
Showing
2 changed files
with
173 additions
and
206 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: Surelog CI | Linux Setup | ||
description: 'Internal Action' | ||
|
||
inputs: | ||
ccache-key: | ||
description: 'Key to be passed to hendrikmuhs/ccache-action.' | ||
required: true | ||
compiler: | ||
description: 'Compiler to install and configure.' | ||
required: true | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
|
||
# Install common dependencies | ||
- shell: bash | ||
run: > | ||
sudo apt-get update -qq && | ||
sudo apt install -y | ||
default-jre | ||
cmake | ||
ninja-build | ||
build-essential | ||
google-perftools | ||
libgoogle-perftools-dev | ||
python3 | ||
python3-orderedmultidict | ||
python3-psutil | ||
python3-dev | ||
uuid-dev | ||
lcov | ||
- shell: bash | ||
if: inputs.compiler == 'clang' | ||
run: | | ||
# Install clang | ||
sudo apt install -y clang | ||
- shell: bash | ||
if: inputs.compiler == 'gcc' | ||
run: | | ||
# Install gcc (gcc) | ||
sudo apt install -y g++-9 | ||
sudo ln -sf /usr/bin/g++-9 /usr/bin/g++ | ||
sudo ln -sf /usr/bin/gcc-9 /usr/bin/gcc | ||
sudo ln -sf /usr/bin/gcov-9 /usr/bin/gcov | ||
- name: Use ccache | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
key: ${{ inputs.ccache-key }} | ||
|
||
- shell: bash | ||
if: inputs.compiler == 'clang' | ||
run: | | ||
# Configure compiler (clang) | ||
echo 'CC=clang' >> $GITHUB_ENV | ||
echo 'CXX=clang++' >> $GITHUB_ENV | ||
- shell: bash | ||
if: inputs.compiler == 'gcc' | ||
run: | | ||
# Configure compiler (gcc) | ||
echo 'CC=gcc-9' >> $GITHUB_ENV | ||
echo 'CXX=g++-9' >> $GITHUB_ENV | ||
- shell: bash | ||
run: | | ||
# Configure shell | ||
echo 'PATH=/usr/lib/ccache:'"$PATH" >> $GITHUB_ENV | ||
echo 'PREFIX=${GITHUB_WORKSPACE}/install' >> $GITHUB_ENV | ||
echo "ADDITIONAL_CMAKE_OPTIONS=-DPython3_ROOT_DIR=${pythonLocation} -DMY_CXX_WARNING_FLAGS='-W -Wall -Wextra -Wno-unused-parameter -Werror -UNDEBUG'" >> $GITHUB_ENV | ||
echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV | ||
- shell: bash | ||
run: | | ||
# Show shell configuration | ||
env | ||
which cmake && cmake --version | ||
which java && java -version | ||
which python && python --version | ||
which ninja && ninja --version | ||
which $CC && $CC --version | ||
which $CXX && $CXX --version |
Oops, something went wrong.