Skip to content

Commit

Permalink
Add CI using GitHub Actions
Browse files Browse the repository at this point in the history
The Travis CI build in this repository no longer works but GitHub provides
its own CI/CD infrastructure which is free for public repositories, quote
from [1]:

  "GitHub Actions usage is free for standard GitHub-hosted runners in public
   repositories [...]"

The list of standard GitHub-hosted runners for public repositories can
be found at the following URL:

  https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories

[1] https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions
  • Loading branch information
andre-schulz committed May 17, 2024
1 parent 1e005bd commit 9fc985e
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: MVE GitHub Actions CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:
name: ${{ matrix.platform.name }}
runs-on: ${{ matrix.platform.os }}

strategy:
fail-fast: false

matrix:
platform:
- { name: Ubuntu 20.04 GCC, os: ubuntu-20.04, cpp_compiler: g++ }
- { name: Ubuntu 20.04 Clang, os: ubuntu-20.04, cpp_compiler: clang++ }
- { name: Ubuntu 22.04 GCC, os: ubuntu-22.04, cpp_compiler: g++ }
- { name: Ubuntu 22.04 Clang, os: ubuntu-22.04, cpp_compiler: clang++ }
- { name: macOS 12, os: macos-12, cpp_compiler: clang++ }
- { name: macOS 13, os: macos-13, cpp_compiler: clang++ }
- { name: macOS 14, os: macos-14, cpp_compiler: clang++ }

env:
CXX: ${{ matrix.platform.cpp_compiler }}

steps:
- uses: actions/checkout@v4

- name: Install Ubuntu dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install \
build-essential \
clang \
libgl-dev \
libgtest-dev \
libjpeg-turbo8-dev \
libomp-dev \
libpng-dev \
libqt5opengl5-dev \
libtiff-dev \
zlib1g-dev
- name: Install macOS dependencies
if: runner.os == 'macOS'
run: |
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
brew update
brew install \
googletest \
jpeg-turbo \
libpng \
libtiff \
qt@5
brew link qt@5
- name: Build MVE on Linux/macOS
run: |
if [ "`uname`" = "Darwin" ]; then
export NUM_CPU_CORES="`sysctl -n hw.ncpu`"
else
export NUM_CPU_CORES="`nproc`"
fi
make -j${NUM_CPU_CORES}
cd apps/umve
qmake
make -j${NUM_CPU_CORES}
cd ../..
make -j${NUM_CPU_CORES} test
- name: Run tests
run: ./tests/test

0 comments on commit 9fc985e

Please sign in to comment.