Skip to content

Commit

Permalink
Update CI scripts to match up with v2
Browse files Browse the repository at this point in the history
  • Loading branch information
eliaskosunen committed Oct 29, 2023
1 parent 72a4bab commit 21dfcd3
Show file tree
Hide file tree
Showing 17 changed files with 798 additions and 217 deletions.
1 change: 1 addition & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ignore:
- "test"
- "src/deps"
- "include/scn/ranges"
31 changes: 0 additions & 31 deletions .github/workflows/alpine.yml

This file was deleted.

85 changes: 85 additions & 0 deletions .github/workflows/arch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Other architectures

on:
push:
branches:
- master
- dev
- v1-update
paths-ignore:
- '**.md'
- '**/docs/**'
pull_request:
branches:
- master
- dev
paths-ignore:
- '**.md'
- '**/docs/**'
workflow_dispatch:

jobs:
other-archs:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
arch: [ armv7, aarch64, riscv64, s390x, ppc64le ]
distro: [ ubuntu22.04 ]

include:
- arch: armv6
distro: bullseye

exclude:
# FIXME: these runs take too long, and time out
- arch: aarch64
- arch: ppc64le

steps:
- name: Checkout
uses: actions/checkout@v4

- uses: uraimo/run-on-arch-action@v2
name: Build and test
id: build
with:
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}

githubToken: ${{ github.token }}

install: |
apt-get update -yq
apt-get install -yq git wget cmake build-essential make g++ ninja-build
run: |
cmake -G Ninja -DSCN_DISABLE_TOP_PROJECT=ON -DSCN_PEDANTIC=ON -DSCN_WERROR=OFF -DSCN_TESTS=ON -B build
cmake --build build -- -k 0
ctest --output-on-failure --test-dir build
vs-arm64-crosscompile:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
include:
- gen: Visual Studio 17 2022
arch: ARM64

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Create Build Environment
run: cmake -E make_directory ${{ runner.workspace }}/build

- name: Run CMake
working-directory: ${{ runner.workspace }}/build
shell: bash
run: |
cmake -G "${{ matrix.gen }}" -A ${{ matrix.arch }} -DCMAKE_CROSSCOMPILING=ON -DSCN_CI=ON $GITHUB_WORKSPACE
- name: Build
working-directory: ${{ runner.workspace }}/build
run: cmake --build . --parallel
62 changes: 37 additions & 25 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,63 @@
name: Code coverage
name: Coverage

on: [ push, pull_request ]
on:
push:
paths-ignore:
- '**.md'
- '**/docs/**'
pull_request:
paths-ignore:
- '**.md'
- '**/docs/**'
workflow_dispatch:

jobs:
codecov:
runs-on: ubuntu-latest
env:
CXX: g++-8
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Setup CMake and Ninja
uses: lukka/get-cmake@latest

- name: Create Build Environment
run: |
sudo locale-gen en_US.UTF-8
sudo locale-gen fi_FI.UTF-8
sudo update-locale
sudo locale -a
sudo apt-get install -yq --no-install-suggests --no-install-recommends --force-yes g++-8
mkdir ${{ runner.workspace }}/lcov
sudo apt-get install -yq lcov
mkdir ${{ runner.workspace }}/build
mkdir ${{ runner.workspace }}/report
- name: Checkout
uses: actions/checkout@v4

- name: Setup lcov
working-directory: ${{ runner.workspace }}/lcov
shell: bash
- name: Run CMake
working-directory: ${{ runner.workspace }}/build
run: |
wget http://downloads.sourceforge.net/ltp/lcov-1.14.tar.gz
tar xvfz lcov-1.14.tar.gz
make -C lcov-1.14
sudo make -C lcov-1.14 install
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_STANDARD=20 \
-DSCN_BUILD_LOCALIZED_TESTS=ON -DSCN_COVERAGE=ON \
-DSCN_BENCHMARKS=OFF -DSCN_EXAMPLES=OFF \
$GITHUB_WORKSPACE
- name: Build
working-directory: ${{ runner.workspace }}/build
run: |
cmake -DSCN_BUILD_LOCALIZED_TESTS=ON -DSCN_COVERAGE=ON -DSCN_BENCHMARKS=OFF -DSCN_EXAMPLES=OFF $GITHUB_WORKSPACE
make -k -j2
cmake --build . -- -k 0
- name: Generate Coverage Report
working-directory: ${{ runner.workspace }}/build
run: |
ctest
lcov --gcov-tool /usr/bin/gcov-8 --directory . --capture --output-file coverage.info
lcov --gcov-tool /usr/bin/gcov-8 --remove coverage.info '/usr/*' 'test/*' 'src/deps/*' --output-file coverage.info
lcov --gcov-tool /usr/bin/gcov-8 --list coverage.info
./coverage.sh
cp coverage-filtered.info ${{ runner.workspace }}/report/coverage.info
- name: Upload Coverage Report
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
directory: ${{ runner.workspace }}/build
directory: ${{ runner.workspace }}/report
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
Loading

0 comments on commit 21dfcd3

Please sign in to comment.