Switch from Travis-CI to Github Actions

This commit is contained in:
sfan5 2021-08-27 16:50:46 +02:00
parent fd4c5dd232
commit f26070ef4f
5 changed files with 70 additions and 34 deletions

51
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,51 @@
name: build
# build on c/cpp changes or workflow changes
on:
push:
paths:
- '**.[ch]'
- '**.cpp'
- '**/CMakeLists.txt'
- '.github/workflows/**.yml'
pull_request:
paths:
- '**.[ch]'
- '**.cpp'
- '**/CMakeLists.txt'
- '.github/workflows/**.yml'
jobs:
gcc:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Install deps
run: |
source util/ci/script.sh
install_linux_deps
- name: Build
run: |
source util/ci/script.sh
run_build
env:
CC: gcc
CXX: g++
clang:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Install deps
run: |
source util/ci/script.sh
install_linux_deps
- name: Build
run: |
source util/ci/script.sh
run_build
env:
CC: clang
CXX: clang++

View File

@ -1,22 +0,0 @@
arch:
- amd64
- ppc64le
language: cpp
compiler:
- gcc
- clang
dist: bionic
addons:
apt:
packages:
- cmake
- libgd-dev
- libsqlite3-dev
- libleveldb-dev
- libpq-dev
- postgresql-server-dev-all
script: ./util/travis/script.sh
notifications:
email: false
matrix:
fast_finish: true

View File

@ -1,13 +1,13 @@
Minetest Mapper C++
===================
.. image:: https://travis-ci.org/minetest/minetestmapper.svg?branch=master
:target: https://travis-ci.org/minetest/minetestmapper
.. image:: https://github.com/minetest/minetestmapper/workflows/build/badge.svg
:target: https://github.com/minetest/minetestmapper/actions/workflows/build.yml
Minetestmapper generates an overview image from a Minetest map.
A port of minetestmapper.py to C++ from https://github.com/minetest/minetest/tree/master/util.
This version is both faster and provides more features than the now deprecated Python script.
A port of minetestmapper.py to C++ from https://github.com/minetest/minetest/tree/0.4.17/util.
This version is both faster and provides more features than the now obsolete Python script.
Requirements
------------

15
util/ci/script.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash -e
install_linux_deps() {
local pkgs=(cmake libgd-dev libsqlite3-dev libleveldb-dev libpq-dev libhiredis-dev)
sudo apt-get update
sudo apt-get install -y --no-install-recommends ${pkgs[@]} "$@"
}
run_build() {
cmake . -DCMAKE_BUILD_TYPE=Debug \
-DENABLE_LEVELDB=1 -DENABLE_POSTGRESQL=1 -DENABLE_REDIS=1
make -j2
}

View File

@ -1,8 +0,0 @@
#!/bin/bash -e
mkdir -p travisbuild
cd travisbuild
cmake .. \
-DENABLE_LEVELDB=1
make -j2