minor cleanup #20
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
name: CI on Linux | |
on: [push, pull_request] | |
env: | |
TZ: Atlantic/Reykjavik | |
defaults: | |
run: | |
shell: bash -ex {0} | |
jobs: | |
build: | |
name: ${{ matrix.name }} | |
runs-on: ubuntu-18.04 | |
timeout-minutes: 120 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: "GCC7 Debug" | |
pkg: "g++-7" | |
cxx: "g++-7" | |
cc: "gcc-7" | |
build_type: Debug | |
- name: "GCC8 Release" | |
pkg: "g++-8" | |
cxx: "g++-8" | |
cc: "gcc-8" | |
build_type: Release | |
- name: "GCC9 Debug" | |
pkg: "g++-9" | |
cxx: "g++-9" | |
cc: "gcc-9" | |
build_type: Debug | |
- name: "GCC10 Debug C++20" | |
pkg: "g++-10" | |
cxx: "g++-10" | |
cc: "gcc-10" | |
cxx_flags: "-std=c++20" | |
build_type: Debug | |
- name: "GCC11 Release C++20" | |
pkg: "g++-11" | |
cxx: "g++-11" | |
cc: "gcc-11" | |
cxx_flags: "-std=c++20" | |
build_type: Release | |
- name: "Clang12 Release C++20" | |
pkg: "clang-12" | |
cxx: "clang++-12" | |
cc: "clang-12" | |
cxx_flags: "-std=c++20" | |
build_type: Release | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
path: src | |
fetch-depth: 2 | |
submodules: recursive | |
- name: Add package source | |
run: | | |
echo 'APT::Acquire::Retries "5";' | sudo tee -a /etc/apt/apt.conf.d/80-retries > /dev/null | |
sudo add-apt-repository --no-update --yes ppa:ubuntu-toolchain-r/ppa | |
sudo add-apt-repository --no-update --yes ppa:ubuntu-toolchain-r/test | |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | |
sudo add-apt-repository --no-update --yes "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main" | |
sudo add-apt-repository --no-update --yes "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main" | |
sudo add-apt-repository --no-update --yes "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-12 main" | |
sudo apt-get update | |
- name: Install Build dependencies | |
run: sudo apt-get install --yes cmake ccache | |
- name: Install compiler ${{ matrix.name }} | |
run: sudo apt-get install --yes ${{ matrix.pkg }} | |
- name: Load ccache | |
uses: actions/cache@v2 | |
with: | |
path: .ccache | |
key: ${{ runner.os }}-${{ matrix.name }}-ccache-${{ github.ref }}-${{ github.run_number }} | |
# Restoring: From current branch, otherwise from base branch, otherwise from any branch. | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.name }}-ccache-${{ github.ref }} | |
${{ runner.os }}-${{ matrix.name }}-ccache-${{ github.base_ref }} | |
${{ runner.os }}-${{ matrix.name }}-ccache- | |
- name: Tool versions | |
run: | | |
env cmake --version | |
env ${{ matrix.cxx }} --version | |
- name: Configure tests | |
env: | |
CXX: ${{ matrix.cxx }} | |
CC: ${{ matrix.cc }} | |
run: | | |
mkdir build | |
cd build | |
cmake ../src -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" | |
- name: Build tests | |
env: | |
CCACHE_BASEDIR: ${{ github.workspace }} | |
CCACHE_DIR: ${{ github.workspace }}/.ccache | |
CCACHE_COMPRESS: true | |
CCACHE_COMPRESSLEVEL: 6 | |
CCACHE_MAXSIZE: 500M | |
run: | | |
ccache -p || true | |
cd build | |
make -k -j2 | |
ccache -s || true | |
- name: Run tests | |
run: | | |
cd build | |
make test | |
./bin/align_ex3 | |
./bin/align_ex8 | |
build-aarch64: | |
name: ARM64 GCC9 Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Build | |
uses: uraimo/run-on-arch-action@v2 | |
with: | |
arch: aarch64 | |
distro: ubuntu20.04 | |
githubToken: ${{ github.token }} | |
dockerRunArgs: | | |
--volume "${PWD}:/paw" | |
install: | | |
apt-get update -q -y | |
apt-get install -q -y gcc g++ make cmake libboost-all-dev file | |
run: | | |
set -x | |
cd /paw | |
mkdir build | |
cd build | |
cmake .. -DCMAKE_CXX_FLAGS_ARCH="-march=native" | |
make -j2 | |
file lib/libpaw.so | grep aarch64 | |
file bin/align_ex2 | grep aarch64 | |
./bin/align_ex2 |