Skip to content

Commit

Permalink
Migrate Travis CI to GitHub Actions
Browse files Browse the repository at this point in the history
Some notes:

- Code coverage still needs work to be enabled
- MacOS pipeline needs to be done

Closes #760
  • Loading branch information
Lihis committed Jan 9, 2025
1 parent d758675 commit dc40371
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 203 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Build and Test

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# Allow to run manually
workflow_dispatch:

env:
BUILD_TYPE: Release
XDG_RUNTIME_DIR: /tmp/openrw-runtimedir
ALSOFT_DRIVERS: "null"

jobs:
archlinux:
name: Arch Linux
runs-on: ubuntu-latest
container:
image: docker.io/archlinux/archlinux:latest
steps:
- name: Install dependencies
run: |
pacman -Syy --noconfirm --disable-sandbox \
git core/gcc extra/llvm extra/clang make ninja curl \
extra/boost extra/cmake extra/ffmpeg extra/bullet extra/glm \
extra/openal extra/sdl2 extra/qt5-base extra/freetype2
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Make runtime directory
run: mkdir -p ${XDG_RUNTIME_DIR}
- name: Build and test
run: mkdir build && cd build && ctest -VV -S ../cmake/ctest/script_ci.ctest
fedora:
name: Fedora
runs-on: ubuntu-latest
container:
image: quay.io/fedora/fedora:latest
steps:
- name: Install dependencies
run: |
dnf install -y git-core boost-devel gcc gcc-c++ clang llvm lcov curl \
boost-devel cmake make ninja-build bullet-devel ffmpeg-free-devel \
glm-devel openal-soft-devel SDL2-devel qt5-qtbase-devel \
freetype-devel libasan
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Make runtime directory
run: mkdir -p ${XDG_RUNTIME_DIR}
- name: Build and test
run: mkdir build && cd build && ctest -VV -S ../cmake/ctest/script_ci.ctest
ubuntu:
name: Ubuntu
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo apt-get update && \
sudo apt-get install --no-install-recommends --no-upgrade -y \
git-core build-essential cmake ninja-build clang llvm lcov curl \
libavcodec-dev libavformat-dev libboost-program-options-dev \
libboost-system-dev libbullet-dev libglm-dev libopenal-dev \
libsdl2-dev libboost-test-dev libqt5opengl5-dev libfreetype6-dev \
iwyu qtbase5-dev qt5-qmake
env:
DEBIAN_FRONTEND: noninteractive
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Make runtime directory
run: mkdir -p ${XDG_RUNTIME_DIR}
- name: Build and test
run: mkdir build && cd build && ctest -VV -S ../cmake/ctest/script_ci.ctest
62 changes: 0 additions & 62 deletions .travis.yml

This file was deleted.

17 changes: 9 additions & 8 deletions cmake/ctest/utils.ctest
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,15 @@ function(openrw_build_name BUILDER_NAME_RES BUILD_NAME_RES)
endif()

if(MODEL_NAME STREQUAL "continuous")
if("$ENV{TRAVIS}")
message(STATUS "Travis detected")
set(BUILDER_NAME "Travis")
set(REPO_NAME "$ENV{TRAVIS_REPO_SLUG}")
set(REPO_BRANCH "$ENV{TRAVIS_BRANCH}")
set(GIT_HASH "$ENV{TRAVIS_COMMIT}")
set(_EVENT_TYPE "$ENV{TRAVIS_EVENT_TYPE}")
set(SUBMIT TRUE)
if("$ENV{GITHUB_ACTIONS}")
message(STATUS "GitHub Actions detected")
set(BUILDER_NAME "GitHub Actions")
set(REPO_NAME "$ENV{GITHUB_REPOSITORY}")
set(REPO_BRANCH "$ENV{GITHUB_REF}")
set(GIT_HASH "$ENV{GITHUB_SHA}")
set(_EVENT_TYPE "$ENV{GITHUB_EVENT_NAME}")
# FIXME: enable submit
set(SUBMIT FALSE)
elseif("$ENV{APPVEYOR}")
message(STATUS "AppVeyor detected")
set(BUILDER_NAME "AppVeyor")
Expand Down
6 changes: 3 additions & 3 deletions cmake_configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ if(TEST_COVERAGE)
if(_RE_REFSPEC)
set(GIT_BRANCH "${CMAKE_MATCH_1}")
message(STATUS "Git branch detected from .git directory: ${GIT_BRANCH}")
elseif(DEFINED ENV{TRAVIS_BRANCH})
set(GIT_BRANCH "$ENV{TRAVIS_BRANCH}")
message(STATUS "Git branch detected from TRAVIS_BRANCH environment variable: ${GIT_BRANCH}")
elseif(DEFINED ENV{GITHUB_REF})
set(GIT_BRANCH "$ENV{GITHUB_REF}")
message(STATUS "Git branch detected from GITHUB_BRANCH environment variable: ${GIT_BRANCH}")
else()
message("Git branch unknown: uploading coverage might nog work")
endif()
Expand Down
30 changes: 0 additions & 30 deletions scripts/docker/arch_latest.docker

This file was deleted.

40 changes: 0 additions & 40 deletions scripts/docker/docker_travis.sh

This file was deleted.

30 changes: 0 additions & 30 deletions scripts/docker/fedora_latest.docker

This file was deleted.

30 changes: 0 additions & 30 deletions scripts/docker/ubuntu_latest.docker

This file was deleted.

0 comments on commit dc40371

Please sign in to comment.