Skip to content

Commit

Permalink
Merge pull request #24 from jtxa/ci-win-mac
Browse files Browse the repository at this point in the history
CI: Add Windows MSYS2, MacOS and QA workflow
  • Loading branch information
sierrafoxtrot authored Nov 5, 2022
2 parents 25a3107 + 9425bc2 commit f8bbb88
Show file tree
Hide file tree
Showing 11 changed files with 272 additions and 93 deletions.
15 changes: 15 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
Checks: >-
-*,
abseil-*,
portability-*,
misc-*,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
-misc-redundant-expression,
# All enabled checks shall be reported as error.
WarningsAsErrors: "*"

# Check all headers of the project.
HeaderFilterRegex: '.*'
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ max_line_length = 80
[*.{html,man,so}]
max_line_length = 400

[*.{yaml,yml}]
[*.{yaml,yml,clang-tidy}]
indent_size = 2
tab_width = 2

Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: CI-Linux
on: [push, pull_request]

jobs:
build:
name: Build and Test
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
compiler:
- gcc-9
- gcc-10
- gcc-11
- clang-12
- clang-13
- clang-14

steps:
- name: Install prerequisites
run: >-
sudo apt-get install -y
libgcrypt20-dev
${{ matrix.compiler }}
cmake
ninja-build
doxygen
graphviz
- uses: actions/checkout@v3

- name: Configure
run: |
export CXX=$(echo ${{ matrix.compiler }} | sed -E 's/^(g|clang)(cc)?/\1++/')
cmake -G Ninja -S . -B build
- name: Build
working-directory: build
run: ninja srecord-executables

- name: Smoke test
working-directory: build
run: ninja srecord-executables-version

- name: Build test prerequisites
working-directory: build
run: ninja prepare-test

- name: Test
working-directory: build
run: ctest --output-on-failure --output-junit ctest.junit.xml
38 changes: 38 additions & 0 deletions .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: CI-MacOS
on: [push, pull_request]

jobs:
build:
name: Build and Test
runs-on: macos-latest

steps:
- name: Install prerequisites
run: >-
brew install
libgcrypt
ninja
doxygen
graphviz
- uses: actions/checkout@v3

- name: Configure
run: cmake -G Ninja -S . -B build

- name: Build
working-directory: build
run: ninja srecord-executables

- name: Smoke test
working-directory: build
run: ninja srecord-executables-version

- name: Build test prerequisites
working-directory: build
run: ninja prepare-test

- name: Test
working-directory: build
run: ctest --output-on-failure --output-junit ctest.junit.xml
59 changes: 59 additions & 0 deletions .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
name: CI-Windows
on: [push, pull_request]

jobs:
build:
name: MSYS2 Build and Test
runs-on: windows-latest

defaults:
run:
shell: msys2 {0}

strategy:
fail-fast: false
matrix:
include:
- sys: mingw64
env: x86_64
- sys: mingw32
env: i686
- sys: ucrt64
env: ucrt-x86_64

steps:
- name: Install prerequisites
uses: msys2/setup-msys2@v2
with:
# cSpell:ignore msystem
msystem: ${{ matrix.sys }}
install: >-
mingw-w64-${{ matrix.env }}-libgcrypt
mingw-w64-${{ matrix.env }}-gcc
mingw-w64-${{ matrix.env }}-cmake
mingw-w64-${{ matrix.env }}-ninja
mingw-w64-${{ matrix.env }}-doxygen
mingw-w64-${{ matrix.env }}-graphviz
diffutils
- uses: actions/checkout@v3

- name: Configure
run: cmake -G Ninja -S . -B build

- name: Build
working-directory: build
run: ninja srecord-executables

- name: Smoke test
working-directory: build
run: ninja srecord-executables-version

- name: Build test prerequisites
working-directory: build
run: ninja prepare-test

- name: Test
working-directory: build
run: ctest --output-on-failure --output-junit ctest.junit.xml
91 changes: 0 additions & 91 deletions .github/workflows/ci.yml

This file was deleted.

91 changes: 91 additions & 0 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
name: QA
on: [push, pull_request]

jobs:
build:
name: Check source
runs-on: ubuntu-22.04

steps:
- name: Install prerequisites
run: >-
sudo apt-get install -y
libgcrypt20-dev
clang-14
clang-tidy-14
cmake
ninja-build
doxygen
graphviz
- uses: actions/checkout@v3

- name: Configure
env:
CXX: clang++-14
CXXFLAGS: >-
-std=c++11
-pedantic
-Wall
SRecord_CMake_Flags: >-
-D CMAKE_EXPORT_COMPILE_COMMANDS=ON
run: |
cmake -G Ninja -S . -B build ${SRecord_CMake_Flags}
- name: Build
working-directory: build
run: ninja srecord-executables

- name: Smoke test
working-directory: build
run: ninja srecord-executables-version

- name: Build test prerequisites
working-directory: build
run: ninja prepare-test

- name: Test
working-directory: build
run: ctest --output-on-failure --output-junit ctest.junit.xml

- name: clang-tidy
if: always()
run: run-clang-tidy-14 -p build

docs:
name: Documentation
runs-on: ubuntu-22.04

steps:
- name: Install prerequisites
run: >-
sudo apt-get install -y
cmake
ninja-build
doxygen
graphviz
groff
psutils
ghostscript
- uses: actions/checkout@v3

- name: Configure
run: cmake -G Ninja -S . -B build

- name: man pages
working-directory: build
run: ninja man

- name: PDF
working-directory: build
run: ninja doco

- name: Doxygen
working-directory: build
run: ninja doxygen

- name: Web Site
working-directory: build
run: ninja man-html web-site
1 change: 1 addition & 0 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ words:
- compl
- CSLEN
- csum
- CXXFLAGS
- DABEDE
- datarec
- dbyte
Expand Down
2 changes: 2 additions & 0 deletions doc/dictionaries/names.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ dg1yfe
DJGPP
Doxygen
dpkg
diffutils
Dragonball
Elektor
Elektuur
Expand Down Expand Up @@ -133,6 +134,7 @@ Torsten
Tridge
troff
TRSDOS
ucrt
Uncia
uudecode
Verilog
Expand Down
2 changes: 1 addition & 1 deletion doc/etc/BUILDING.man
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ will install updates flagged in the updated database.:
\f[I]\&...lots of output...\fP
\f[B]% \fPpacman -Syu
\f[I]\&...lots of output...\fP
\f[B]% \fPpacman -S mingw-w64-x86_64-gcc groff \\
\f[B]% \fPpacman -S mingw-w64-x86_64-gcc diffutils groff \\
\f[B] \fP mingw-w64-x86_64-libgcrypt mingw-w64-x86_64-cmake \\
\f[B] \fP mingw-w64-x86_64-graphviz mingw-w64-x86_64-ninja \\
\f[B] \fP mingw-w64-x86_64-doxygen mingw-w64-i686-ghostscript \\
Expand Down
Loading

0 comments on commit f8bbb88

Please sign in to comment.