Skip to content

Commit

Permalink
workflows: add basic github build workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper committed Nov 17, 2024
1 parent d986f92 commit 4fc77d6
Show file tree
Hide file tree
Showing 4 changed files with 207 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/actionlint-matcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"problemMatcher": [
{
"owner": "actionlint",
"pattern": [
{
"regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$",
"file": 1,
"line": 2,
"column": 3,
"message": 4,
"code": 5
}
]
}
]
}
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
146 changes: 146 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: Build PR(s) and master branch.
on:
push:
branches:
- master
pull_request:
branches:
- master
types: [opened, reopened, synchronize]
jobs:
build-windows:
name: Build sources on amd64 for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, windows-2019]
permissions:
contents: read
steps:
- uses: actions/checkout@v3
with:
submodules: true

- name: Build on ${{ matrix.os }} with vs-2019
run: |
.\scripts\win_build.bat
- name: Run unit tests.
run: |
ctest --rerun-failed --output-on-failure -C Debug --test-dir .\tests\
build-centos:
name: CentOS 7 build to confirm no issues once used downstream
runs-on: ubuntu-latest
container: centos:7
permissions:
contents: none
steps:
- name: Set up base image dependencies
run: |
sed -i -e "s/^mirrorlist=http:\/\/mirrorlist.centos.org/#mirrorlist=http:\/\/mirrorlist.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo
sed -i -e "s/^#baseurl=http:\/\/mirror.centos.org/baseurl=http:\/\/vault.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo
yum -y update && \
yum install -y ca-certificates cmake curl-devel gcc gcc-c++ git make wget && \
yum install -y epel-release
yum install -y cmake3
shell: bash

- name: Clone repo with submodules (1.8.3 version of Git)
run: |
git clone --recursive https://github.com/fluent/cprofiles.git
shell: bash

- name: Run compilation
run: |
cmake3 -DCPROF_DEV=on .
make
shell: bash
working-directory: cprofiles

build-unix-arm64:
name: Build sources on arm64 for ${{ matrix.os }} - ${{ matrix.compiler }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
compiler: [ gcc, clang ]
permissions:
contents: read
steps:
- uses: actions/checkout@v3
with:
submodules: true

- name: Build on ${{ matrix.os }} with ${{ matrix.compiler }}
uses: uraimo/[email protected]
with:
arch: aarch64
distro: ubuntu20.04
run: |
apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
cmake \
file \
make
export CC=${{ env.compiler }}
cmake -DCTR_TESTS=On .
make all
CTEST_OUTPUT_ON_FAILURE=1 make test
env:
CC: ${{ matrix.compiler }}

build-unix-amd64:
name: Build sources on amd64 for ${{ matrix.os }} - ${{ matrix.compiler }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
compiler: [ gcc, clang ]
permissions:
contents: read
steps:
- uses: actions/checkout@v3
with:
submodules: true

- name: Build on ${{ matrix.os }} with ${{ matrix.compiler }}
run: |
echo "CC = $CC, CXX = $CXX"
cmake -DCTR_TESTS=On .
make all
CTEST_OUTPUT_ON_FAILURE=1 make test
shell: bash
env:
CC: ${{ matrix.compiler }}

build-analysis-tests:
name: Build with various code analysis tools
strategy:
fail-fast: false
matrix:
preset:
- clang-sanitize-address
- clang-sanitize-memory
- clang-sanitize-undefined
- clang-sanitize-dataflow
- clang-sanitize-safe-stack
- valgrind
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true

- uses: docker://lpenz/ghaction-cmake:0.19
with:
preset: ${{ matrix.preset }}
# dependencies_debian: ''
cmakeflags: '-DCTR_TESTS=On -DCMT_DEV=on .'
build_command: make all
32 changes: 32 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Lint PRs
on:
pull_request:
workflow_dispatch:

jobs:

shellcheck-pr:
runs-on: ubuntu-latest
name: PR - Shellcheck
steps:
- uses: actions/checkout@v3
- uses: ludeeus/action-shellcheck@master

actionlint-pr:
runs-on: ubuntu-latest
name: PR - Actionlint
steps:
- uses: actions/checkout@v3
- run: |
echo "::add-matcher::.github/actionlint-matcher.json"
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
./actionlint -color -shellcheck=
shell: bash
docslint-pr:
runs-on: ubuntu-latest
name: PR - Markdownlint
steps:
- uses: actions/checkout@v3
- name: Run markdownlint
uses: actionshub/[email protected]

0 comments on commit 4fc77d6

Please sign in to comment.