Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI modernization #172

Merged
merged 3 commits into from
Aug 29, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
53 changes: 27 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,39 @@ on: [push, pull_request]

jobs:
build_linux:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
build_config:
- { cc: gcc, cxx: g++, version: 11 }
- { cc: gcc, cxx: g++, version: 10 }
- { cc: gcc, cxx: g++, version: 9 }
- { cc: gcc, cxx: g++, version: 8 }
- { cc: gcc, cxx: g++, version: 7 }
- { cc: clang, cxx: clang++, version: 14 }
- { cc: clang, cxx: clang++, version: 13 }
- { cc: clang, cxx: clang++, version: 12 }
- { cc: clang, cxx: clang++, version: 11 }
- { cc: clang, cxx: clang++, version: 10 }
- { cc: clang, cxx: clang++, version: 9 }
- { cc: gcc, cxx: g++, version: 10, args: "-DDEFLATE_SUPPORT=OFF" }
- { compiler: gcc, version: 12 }
- { compiler: gcc, version: 11 }
- { compiler: gcc, version: 10 }
- { compiler: gcc, version: 9 }
- { compiler: gcc, version: 8 }
- { compiler: gcc, version: 7 }
- { compiler: clang, version: 14 }
- { compiler: clang, version: 13 }
- { compiler: clang, version: 12 }
- { compiler: clang, version: 11 }
- { compiler: clang, version: 10 }
- { compiler: clang, version: 9 }
- { compiler: gcc, version: 10, args: "-DDEFLATE_SUPPORT=OFF" }
container:
image: ${{ matrix.build_config.compiler == 'clang' && 'teeks99/clang-ubuntu' || matrix.build_config.compiler }}:${{ matrix.build_config.version }}
env:
CC: ${{ matrix.build_config.cc }}-${{ matrix.build_config.version }}
CXX: ${{ matrix.build_config.cxx }}-${{ matrix.build_config.version }}
JOBS: 2
name: "${{ matrix.build_config.cc }}-${{ matrix.build_config.version }} ${{ matrix.build_config.args }}"
name: "${{ matrix.build_config.compiler }}-${{ matrix.build_config.version }} ${{ matrix.build_config.args }}"
steps:
- uses: actions/checkout@main
- name: Setup Clang
if: matrix.build_config.cc == 'clang'
if: matrix.build_config.compiler == 'clang'
run: |
sudo scripts/ci_setup_clang.sh ${{ matrix.build_config.version }}
scripts/ci_setup_clang.sh ${{ matrix.build_config.version }}
echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV
- name: Setup GCC
if: matrix.build_config.cc == 'gcc'
run: |
sudo apt-get update
sudo apt-get install -y gcc-${{ matrix.build_config.version }} g++-${{ matrix.build_config.version }}
echo "CC=clang-${{ matrix.build_config.version }}" >> $GITHUB_ENV
echo "CXX=clang++-${{ matrix.build_config.version }}" >> $GITHUB_ENV
- name: Setup
run: sudo apt-get install -y valgrind
run: apt-get update && apt-get install -y cmake valgrind zlib1g-dev git
- name: Build
run: |
cmake . -Bbuild -DCMAKE_BUILD_TYPE=Release -DCOVERAGE=ON ${{ matrix.build_config.args }}
Expand All @@ -49,7 +47,10 @@ jobs:
cmake --build . --target test
ctest -D ExperimentalBuild -j${JOBS}
ctest -D ExperimentalMemCheck -j${JOBS}
bash <(curl -s https://codecov.io/bash)
- name: CodeCov
uses: codecov/codecov-action@v3
with:
gcov: true
build_msvc:
runs-on: windows-latest
strategy:
Expand All @@ -58,7 +59,7 @@ jobs:
- {args: "-DDEFLATE_SUPPORT=OFF", config: "Debug"}
steps:
- uses: actions/checkout@main
- uses: actions/setup-python@v2
- uses: actions/setup-python@main
with:
python-version: '3.x'
- name: Build
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ on:

jobs:
codeql:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
name: "CodeQL"
env:
CC: gcc-10
CXX: g++-10
container:
image: gcc:10
steps:
- name: Checkout
uses: actions/checkout@main
- name: Setup
run: apt-get update && apt-get install -y cmake zlib1g-dev
- name: CodeQL Initialization
uses: github/codeql-action/init@v2
with:
Expand Down
4 changes: 1 addition & 3 deletions scripts/ci_setup_clang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

VERSION=$1

wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-${VERSION} main"
apt update
apt-get install -y clang-${VERSION} libc++-${VERSION}-dev libc++abi-${VERSION}-dev
apt-get install -y libc++-${VERSION}-dev libc++abi-${VERSION}-dev

if [[ ${VERSION} -ge 12 ]]; then
apt-get install -y --no-install-recommends libunwind-${VERSION}-dev
Expand Down