Make the repo REUSE compliant and add a CI check #141
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
# SPDX-License-Identifier: GPL-3.0-or-later | |
# Copyright © 2022–2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH | |
# Matthias Kretz <[email protected]> | |
name: CI | |
on: | |
push: | |
branches: [ master, main ] | |
pull_request: | |
jobs: | |
gcc: | |
strategy: | |
fail-fast: false | |
matrix: | |
version: [9, 10, 11, 12, 13] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: vir-simd | |
- name: Cache test data | |
id: cache-testdata | |
uses: actions/cache@v4 | |
with: | |
path: vc-testdata | |
key: testdata-1 | |
enableCrossOsArchive: true | |
- name: Download test data | |
if: steps.cache-testdata.outputs.cache-hit != 'true' | |
uses: actions/checkout@v4 | |
with: | |
repository: VcDevel/vc-testdata | |
path: vc-testdata | |
- name: Install GCC ${{ matrix.version }} | |
run: | | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test | |
sudo apt-get update | |
sudo apt-get install -y gcc-${{ matrix.version }} g++-${{ matrix.version }} | |
- name: Test installation | |
env: | |
CXX: g++-${{ matrix.version }} | |
run: | | |
cmake -S vir-simd -B cmake-build -DCMAKE_INSTALL_PREFIX:STRING=$HOME/vir-simd-cmake | |
cmake --build cmake-build --target install | |
cd vir-simd && make prefix=$HOME/vir-simd-make install | |
diff -r $HOME/vir-simd-cmake/include $HOME/vir-simd-make/include && echo "cmake and make installations match ✅" | |
- name: Run test suite | |
env: | |
CXX: g++-${{ matrix.version }} | |
run: cd vir-simd && make check DRIVEROPTS=-vvf | |
clang: | |
strategy: | |
fail-fast: false | |
matrix: | |
version: [16, 17] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: vir-simd | |
- name: Cache test data | |
id: cache-testdata | |
uses: actions/cache@v4 | |
with: | |
path: vc-testdata | |
key: testdata-1 | |
enableCrossOsArchive: true | |
- name: Download test data | |
if: steps.cache-testdata.outputs.cache-hit != 'true' | |
uses: actions/checkout@v4 | |
with: | |
repository: VcDevel/vc-testdata | |
path: vc-testdata | |
- name: Install Clang ${{ matrix.version }} | |
run: | | |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - | |
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${{ matrix.version }} main' | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test | |
sudo apt-get update | |
sudo apt-get install -y g++-13 clang-${{ matrix.version }} | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 110 --slave /usr/bin/g++ g++ /usr/bin/g++-13 | |
- name: Run test suite | |
env: | |
CXX: clang++-${{ matrix.version }} | |
run: cd vir-simd && make check DRIVEROPTS=-vvf | |
clang-libcxx: | |
strategy: | |
fail-fast: false | |
matrix: | |
version: [15, 17] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: vir-simd | |
- name: Cache test data | |
id: cache-testdata | |
uses: actions/cache@v4 | |
with: | |
path: vc-testdata | |
key: testdata-1 | |
enableCrossOsArchive: true | |
- name: Download test data | |
if: steps.cache-testdata.outputs.cache-hit != 'true' | |
uses: actions/checkout@v4 | |
with: | |
repository: VcDevel/vc-testdata | |
path: vc-testdata | |
- name: Install Clang ${{ matrix.version }} | |
run: | | |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - | |
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${{ matrix.version }} main' | |
sudo apt-get update | |
sudo apt-get install -y clang-${{ matrix.version }} libc++-${{ matrix.version }}-dev libc++abi-${{ matrix.version }}-dev | |
- name: Run test suite | |
env: | |
CXX: clang++-${{ matrix.version }} | |
CXXFLAGS: -stdlib=libc++ | |
run: cd vir-simd && make check DRIVEROPTS=-vvf | |
emscripten: | |
strategy: | |
fail-fast: true | |
matrix: | |
version: [ latest ] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install emscripten ${{ matrix.version }} | |
run: | | |
cd | |
git clone --depth=1 https://github.com/emscripten-core/emsdk.git | |
cd emsdk | |
./emsdk install ${{ matrix.version }} | |
./emsdk activate ${{ matrix.version }} | |
- name: Run test suite | |
shell: bash | |
env: | |
CXX: em++ | |
run: | | |
source ~/emsdk/emsdk_env.sh | |
make check DRIVEROPTS=-vvf | |
msvc: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-2022] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: vir-simd | |
- name: Cache test data | |
id: cache-testdata | |
uses: actions/cache@v4 | |
with: | |
path: vc-testdata | |
key: testdata-1 | |
enableCrossOsArchive: true | |
- name: Download test data | |
if: steps.cache-testdata.outputs.cache-hit != 'true' | |
uses: actions/checkout@v4 | |
with: | |
repository: VcDevel/vc-testdata | |
path: vc-testdata | |
- name: Configure test | |
run: cmake -S vir-simd -B build -DCMAKE_BUILD_TYPE:STRING=Release | |
- name: Compile test | |
run: cmake --build build --config Release --target check |