2020-11-03 18:45:16 +00:00
|
|
|
name: linux
|
|
|
|
|
2020-11-04 00:01:26 +00:00
|
|
|
on: [push, pull_request]
|
2020-11-03 18:04:28 +00:00
|
|
|
|
2022-05-30 00:58:11 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2020-11-03 18:04:28 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
2022-09-27 18:38:46 +00:00
|
|
|
runs-on: ubuntu-20.04
|
2020-11-03 19:41:25 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-04-01 15:24:55 +00:00
|
|
|
cxx: [g++-4.8, g++-10, clang++-9]
|
2020-11-03 20:16:15 +00:00
|
|
|
build_type: [Debug, Release]
|
2020-11-14 19:52:35 +00:00
|
|
|
std: [11]
|
2020-11-04 00:48:01 +00:00
|
|
|
include:
|
2020-11-14 19:52:35 +00:00
|
|
|
- cxx: g++-4.8
|
|
|
|
install: sudo apt install g++-4.8
|
|
|
|
- cxx: g++-8
|
2021-04-07 23:49:30 +00:00
|
|
|
build_type: Debug
|
2020-11-14 19:52:35 +00:00
|
|
|
std: 14
|
2021-04-01 15:24:55 +00:00
|
|
|
install: sudo apt install g++-8
|
2022-06-30 16:16:23 +00:00
|
|
|
- cxx: g++-8
|
|
|
|
build_type: Debug
|
|
|
|
std: 17
|
|
|
|
install: sudo apt install g++-8
|
2022-09-10 20:25:20 +00:00
|
|
|
- cxx: g++-9
|
|
|
|
build_type: Debug
|
|
|
|
std: 17
|
2020-11-14 19:52:35 +00:00
|
|
|
- cxx: g++-10
|
2021-04-07 23:49:30 +00:00
|
|
|
build_type: Debug
|
2020-11-14 19:52:35 +00:00
|
|
|
std: 17
|
2024-05-26 17:58:26 +00:00
|
|
|
- cxx: g++-11
|
|
|
|
build_type: Debug
|
|
|
|
std: 20
|
|
|
|
install: sudo apt install g++-11
|
2022-06-30 16:16:23 +00:00
|
|
|
- cxx: clang++-8
|
|
|
|
build_type: Debug
|
|
|
|
std: 17
|
|
|
|
cxxflags: -stdlib=libc++
|
|
|
|
install: sudo apt install clang-8 libc++-8-dev libc++abi-8-dev
|
2022-09-27 18:38:46 +00:00
|
|
|
- cxx: clang++-9
|
|
|
|
install: sudo apt install clang-9
|
2020-11-08 13:18:24 +00:00
|
|
|
- cxx: clang++-9
|
2020-11-04 00:48:01 +00:00
|
|
|
build_type: Debug
|
|
|
|
fuzz: -DFMT_FUZZ=ON -DFMT_FUZZ_LINKMAIN=ON
|
2020-11-14 19:52:35 +00:00
|
|
|
std: 17
|
2022-09-27 18:38:46 +00:00
|
|
|
install: sudo apt install clang-9
|
2021-04-08 00:18:13 +00:00
|
|
|
- cxx: clang++-11
|
|
|
|
build_type: Debug
|
|
|
|
std: 20
|
2021-04-08 00:25:40 +00:00
|
|
|
- cxx: clang++-11
|
|
|
|
build_type: Debug
|
|
|
|
std: 20
|
|
|
|
cxxflags: -stdlib=libc++
|
|
|
|
install: sudo apt install libc++-11-dev libc++abi-11-dev
|
2021-05-18 12:38:55 +00:00
|
|
|
- shared: -DBUILD_SHARED_LIBS=ON
|
2020-11-03 18:04:28 +00:00
|
|
|
|
|
|
|
steps:
|
2023-10-01 16:49:05 +00:00
|
|
|
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
|
2022-09-27 18:38:46 +00:00
|
|
|
|
2022-12-22 15:25:12 +00:00
|
|
|
- name: Set timezone
|
|
|
|
run: sudo timedatectl set-timezone 'Asia/Yekaterinburg'
|
|
|
|
|
2022-09-27 18:38:46 +00:00
|
|
|
- name: Add repositories for older GCC
|
|
|
|
run: |
|
2023-02-21 23:14:41 +00:00
|
|
|
# Below two repos provide GCC 4.8, 5.5 and 6.4
|
2022-09-27 18:38:46 +00:00
|
|
|
sudo apt-add-repository 'deb http://azure.archive.ubuntu.com/ubuntu/ bionic main'
|
|
|
|
sudo apt-add-repository 'deb http://azure.archive.ubuntu.com/ubuntu/ bionic universe'
|
2023-02-21 23:14:41 +00:00
|
|
|
# Below two repos additionally update GCC 6 to 6.5
|
2022-09-27 18:38:46 +00:00
|
|
|
# sudo apt-add-repository 'deb http://azure.archive.ubuntu.com/ubuntu/ bionic-updates main'
|
|
|
|
# sudo apt-add-repository 'deb http://azure.archive.ubuntu.com/ubuntu/ bionic-updates universe'
|
|
|
|
if: ${{ matrix.cxx == 'g++-4.8' }}
|
2020-11-03 18:04:28 +00:00
|
|
|
|
2024-05-26 17:58:26 +00:00
|
|
|
- name: Add repositories for newer GCC
|
|
|
|
run: |
|
|
|
|
sudo apt-add-repository ppa:ubuntu-toolchain-r/test
|
|
|
|
if: ${{ matrix.cxx == 'g++-11' }}
|
|
|
|
|
2023-02-12 15:46:50 +00:00
|
|
|
- name: Add ubuntu mirrors
|
|
|
|
run: |
|
|
|
|
# Github Actions caching proxy is at times unreliable
|
|
|
|
# see https://github.com/actions/runner-images/issues/7048
|
|
|
|
printf 'http://azure.archive.ubuntu.com/ubuntu\tpriority:1\n' | sudo tee /etc/apt/mirrors.txt
|
|
|
|
curl http://mirrors.ubuntu.com/mirrors.txt | sudo tee --append /etc/apt/mirrors.txt
|
|
|
|
sudo sed -i 's~http://azure.archive.ubuntu.com/ubuntu/~mirror+file:/etc/apt/mirrors.txt~' /etc/apt/sources.list
|
|
|
|
|
2020-11-03 18:04:28 +00:00
|
|
|
- name: Create Build Environment
|
2020-11-04 00:48:01 +00:00
|
|
|
run: |
|
2023-02-12 15:46:50 +00:00
|
|
|
sudo apt update
|
2020-11-04 00:48:01 +00:00
|
|
|
${{matrix.install}}
|
2021-06-10 19:30:34 +00:00
|
|
|
sudo apt install locales-all
|
2020-11-04 00:48:01 +00:00
|
|
|
cmake -E make_directory ${{runner.workspace}}/build
|
2020-11-03 18:04:28 +00:00
|
|
|
|
2020-11-03 22:02:07 +00:00
|
|
|
- name: Configure
|
2020-11-03 18:04:28 +00:00
|
|
|
working-directory: ${{runner.workspace}}/build
|
2020-11-03 19:49:35 +00:00
|
|
|
env:
|
|
|
|
CXX: ${{matrix.cxx}}
|
2020-11-15 17:03:20 +00:00
|
|
|
CXXFLAGS: ${{matrix.cxxflags}}
|
2020-11-03 22:02:07 +00:00
|
|
|
run: |
|
2021-05-18 12:38:55 +00:00
|
|
|
cmake -DCMAKE_BUILD_TYPE=${{matrix.build_type}} ${{matrix.fuzz}} ${{matrix.shared}} \
|
2020-11-14 19:52:35 +00:00
|
|
|
-DCMAKE_CXX_STANDARD=${{matrix.std}} -DFMT_DOC=OFF \
|
2021-05-18 12:38:55 +00:00
|
|
|
-DCMAKE_CXX_VISIBILITY_PRESET=hidden -DCMAKE_VISIBILITY_INLINES_HIDDEN=ON \
|
2020-11-14 19:52:35 +00:00
|
|
|
-DFMT_PEDANTIC=ON -DFMT_WERROR=ON $GITHUB_WORKSPACE
|
2020-11-03 18:04:28 +00:00
|
|
|
|
|
|
|
- name: Build
|
|
|
|
working-directory: ${{runner.workspace}}/build
|
2021-06-03 05:00:00 +00:00
|
|
|
run: |
|
|
|
|
threads=`nproc`
|
|
|
|
cmake --build . --config ${{matrix.build_type}} --parallel $threads
|
2020-11-03 18:04:28 +00:00
|
|
|
|
|
|
|
- name: Test
|
|
|
|
working-directory: ${{runner.workspace}}/build
|
2020-11-03 20:16:15 +00:00
|
|
|
run: ctest -C ${{matrix.build_type}}
|
2021-05-06 16:20:46 +00:00
|
|
|
env:
|
|
|
|
CTEST_OUTPUT_ON_FAILURE: True
|