Commit fd07ca75 authored by Robert Edmonds's avatar Robert Edmonds

build.yml: Reformat

parent 17398154
name: Test Build name: Test Builds
on: on:
push: push:
branches: branches:
- master - master
- next - next
pull_request: pull_request:
types: [ opened, reopened, synchronize, edited, ready_for_review, review_requested ] types: [ opened, reopened, synchronize, edited, ready_for_review, review_requested ]
schedule: schedule:
- cron: '0 0 * * 5' # Every Friday at 00:00 - cron: '0 0 * * 5' # Every Friday at 00:00
jobs: jobs:
distcheck: distcheck:
runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
os: [macos-latest, ubuntu-22.04, ubuntu-24.04] os: [macos-latest, ubuntu-22.04, ubuntu-24.04]
fail-fast: false fail-fast: false
runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v4 - name: Checkout protobuf-c
uses: actions/checkout@v4
- name: Install Linux dependencies - name: Install Linux dependencies
if: startsWith(matrix.os, 'ubuntu') if: startsWith(matrix.os, 'ubuntu')
run: | run: |
sudo apt-get update -y sudo apt-get update -q -y
sudo apt-get install -y protobuf-compiler libprotobuf-dev libprotoc-dev sudo apt-get install -q -y \
libprotobuf-dev \
libprotoc-dev \
protobuf-compiler \
;
- name: Install Mac dependencies - name: Install Mac dependencies
if: startsWith(matrix.os, 'macos') if: startsWith(matrix.os, 'macos')
run: brew install protobuf automake libtool run: brew install protobuf automake libtool
- name: Run distcheck - name: Run distcheck
run: | run: |
./autogen.sh ./autogen.sh
...@@ -33,6 +47,7 @@ jobs: ...@@ -33,6 +47,7 @@ jobs:
distcheck-multiarch: distcheck-multiarch:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
strategy: strategy:
matrix: matrix:
include: include:
...@@ -42,10 +57,13 @@ jobs: ...@@ -42,10 +57,13 @@ jobs:
- arch: s390x - arch: s390x
- arch: ppc64le - arch: ppc64le
fail-fast: false fail-fast: false
steps: steps:
- uses: actions/checkout@v4 - name: Checkout protobuf-c
- uses: uraimo/run-on-arch-action@v2 uses: actions/checkout@v4
name: Install dependencies and run distcheck
- name: Install dependencies and run distcheck on multiple arches
uses: uraimo/run-on-arch-action@v2
id: runcmd id: runcmd
with: with:
arch: ${{ matrix.arch }} arch: ${{ matrix.arch }}
...@@ -53,8 +71,16 @@ jobs: ...@@ -53,8 +71,16 @@ jobs:
distro: ubuntu22.04 distro: ubuntu22.04
install: | install: |
apt-get update -q -y apt-get update -q -y
apt-get install -q -y build-essential autoconf automake libtool pkg-config apt-get install -q -y \
apt-get install -q -y protobuf-compiler libprotobuf-dev libprotoc-dev autoconf \
automake \
build-essential \
libprotobuf-dev \
libprotoc-dev \
libtool \
pkg-config \
protobuf-compiler \
;
run: | run: |
./autogen.sh ./autogen.sh
...@@ -63,27 +89,52 @@ jobs: ...@@ -63,27 +89,52 @@ jobs:
valgrind: valgrind:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
steps: steps:
- uses: actions/checkout@v4 - name: Checkout protobuf-c
uses: actions/checkout@v4
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo apt-get update -y sudo apt-get update -q -y
sudo apt-get install -y protobuf-compiler libprotobuf-dev libprotoc-dev valgrind sudo apt-get install -q -y \
libprotobuf-dev \
libprotoc-dev \
protobuf-compiler \
valgrind \
;
- name: Run distcheck with valgrind - name: Run distcheck with valgrind
run: | run: |
./autogen.sh ./autogen.sh
./configure --enable-valgrind-tests CFLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined" ./configure \
make -j${nproc} distcheck DISTCHECK_CONFIGURE_FLAGS="--enable-valgrind-tests CFLAGS=\"-fsanitize=undefined -fno-sanitize-recover=undefined\"" VERBOSE=1 --enable-valgrind-tests \
CFLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined" \
;
make -j${nproc} \
distcheck \
DISTCHECK_CONFIGURE_FLAGS="--enable-valgrind-tests CFLAGS=\"-fsanitize=undefined -fno-sanitize-recover=undefined\"" \
VERBOSE=1 \
;
coverage: coverage:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
steps: steps:
- uses: actions/checkout@v4 - name: Checkout protobuf-c
uses: actions/checkout@v4
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo apt-get update -y sudo apt-get update -q -y
sudo apt-get install -y protobuf-compiler libprotobuf-dev libprotoc-dev lcov sudo apt-get install -q -y \
- name: Run coverage build lcov \
libprotobuf-dev \
libprotoc-dev \
protobuf-compiler \
;
- name: Build protobuf-c and run coverage build
run: | run: |
./autogen.sh ./autogen.sh
./configure --enable-code-coverage ./configure --enable-code-coverage
...@@ -92,30 +143,42 @@ jobs: ...@@ -92,30 +143,42 @@ jobs:
lcov --no-external --capture --initial --directory . --output-file ./coverage/lcov.info --include '*protobuf-c.c' lcov --no-external --capture --initial --directory . --output-file ./coverage/lcov.info --include '*protobuf-c.c'
make check make check
lcov --no-external --capture --directory . --output-file ./coverage/lcov.info --include '*protobuf-c.c' lcov --no-external --capture --directory . --output-file ./coverage/lcov.info --include '*protobuf-c.c'
- uses: coverallsapp/github-action@master
- name: Upload Coveralls results
uses: coverallsapp/github-action@master
with: with:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
cmake: cmake:
runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
build_type: [Debug, Release] build_type: [Debug, Release]
os: [macos-latest, ubuntu-22.04, ubuntu-24.04] os: [macos-latest, ubuntu-22.04, ubuntu-24.04]
fail-fast: false fail-fast: false
runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v4 - name: Checkout protobuf-c
uses: actions/checkout@v4
- name: Install Linux dependencies - name: Install Linux dependencies
if: startsWith(matrix.os, 'ubuntu') if: startsWith(matrix.os, 'ubuntu')
run: | run: |
sudo apt-get update -y sudo apt-get update -y
sudo apt-get install -y protobuf-compiler libprotobuf-dev libprotoc-dev sudo apt-get install -y protobuf-compiler libprotobuf-dev libprotoc-dev
- name: Install Mac dependencies - name: Install Mac dependencies
if: startsWith(matrix.os, 'macos') if: startsWith(matrix.os, 'macos')
run: brew install protobuf abseil run: brew install protobuf abseil
- name: Run cmake tests
- name: Build protobuf-c and run tests
run: | run: |
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_TESTS=ON -DCMAKE_INSTALL_PREFIX=protobuf-c-bin -S "build-cmake" -B "build" cmake -S build-cmake -B build \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_INSTALL_PREFIX=protobuf-c-bin \
-DBUILD_TESTS=ON \
;
cmake --build "build" -j3 cmake --build "build" -j3
cmake --build "build" --target test cmake --build "build" --target test
cmake --build "build" --target install cmake --build "build" --target install
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment