Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workflow docker #185

Draft
wants to merge 27 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Makefile CI

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

jobs:
docker:

strategy:
matrix:
ubuntu: [22.04, 20.04]
libgtk: [libgtk-3-dev, libgtk2.0-dev]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
docker:
- 'docker/**'
- name: Build and push
uses: docker/build-push-action@v4
with:
context: "{{defaultContext}}:docker/build"
build-args: |
UBUNTU_VERSION=${{ matrix.ubuntu }}
LIBGTK=${{ matrix.libgtk }}
push: true
tags: ghcr.io/guyou/viking-build-env:${{ matrix.ubuntu }}-${{ matrix.libgtk }}
if: steps.changes.outputs.docker == 'true'

build:
if: ${{ always() }}
needs: docker

strategy:
fail-fast: false
matrix:
ubuntu: [22.04, 20.04]
libgtk: [libgtk-3-dev, libgtk2.0-dev]

runs-on: ubuntu-latest
container:
image: ghcr.io/guyou/viking-build-env:${{ matrix.ubuntu }}-${{ matrix.libgtk }}

steps:
- uses: actions/checkout@v3

- name: Configure
run: ./autogen.sh ${{ matrix.libgtk == 'libgtk2.0-dev' && '--enable-gtk2' || '' }}

- name: Build
run: make

- name: Run check
uses: coactions/setup-xvfb@v1
with:
run: make check

- uses: actions/upload-artifact@v3
if: failure()
with:
name: test-suite-log
path: test/test-suite.log
retention-days: 5

- name: Run distcheck
run: make distcheck DISTCHECK_CONFIGURE_FLAGS=${{ matrix.libgtk == 'libgtk2.0-dev' && '--enable-gtk2' || '' }}
50 changes: 0 additions & 50 deletions .travis.yml

This file was deleted.

6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Viking [![Build Status](https://travis-ci.com/viking-gps/viking.svg?branch=master)](https://travis-ci.com/viking-gps/viking)
# Viking ![Build Status](https://github.com/viking-gps/viking/actions/workflows/makefile.yml/badge.svg)
[![GitHub license](https://img.shields.io/github/license/viking-gps/viking)](https://github.com/viking-gps/viking/master/COPYING)

[![Build history](https://buildstats.info/travisci/chart/viking-gps/viking?branch=master&showStats=true)](https://travis-ci.com/viking-gps/viking/builds)

Viking is a free/open source program to manage GPS data. You can
import, plot and create tracks, routes and waypoints, show OSM
and other maps, generate maps (using Mapnik),
Expand All @@ -29,7 +27,7 @@ Git repository:

On Debian Sid, following packages must be installed before building:

$ sudo apt install gtk-doc-tools docbook-xsl yelp-tools libpng-dev libgtk-3-dev libicu-dev libjson-glib-dev intltool xxd
$ sudo apt install gtk-doc-tools docbook-xsl yelp-tools libpng-dev libgtk-3-dev libicu-dev libjson-glib-dev intltool autopoint xxd

The following packages are needed (they are included by default in Debian Sid, but not in other distributions). They must be installed too:

Expand Down
11 changes: 11 additions & 0 deletions docker/build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ARG UBUNTU_VERSION=22.04

FROM ubuntu:$UBUNTU_VERSION

ARG LIBGTK=libgtk-3-dev

ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && \
apt install -y build-essential gtk-doc-tools docbook-xsl yelp-tools libpng-dev $LIBGTK libicu-dev libjson-glib-dev intltool autopoint xxd libcurl4-gnutls-dev libglib2.0-dev-bin libsqlite3-dev nettle-dev libmapnik-dev libgeoclue-2-dev libgexiv2-dev libgps-dev libmagic-dev libbz2-dev libzip-dev liboauth-dev libnova-dev && \
apt install -y xvfb x11-xserver-utils sudo && \
rm -rf /var/lib/apt/lists/*
18 changes: 18 additions & 0 deletions docker/build/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
all: \
ubuntu2004-gtk3 \
ubuntu2004-gtk2 \
ubuntu2204-gtk3 \
ubuntu2204-gtk2

ubuntu2004-gtk3:
docker build --build-arg UBUNTU_VERSION=20.04 --build-arg LIBGTK=libgtk-3-dev -t viking-build:$@ .

ubuntu2004-gtk2:
docker build --build-arg UBUNTU_VERSION=20.04 --build-arg LIBGTK=libgtk2.0-dev -t viking-build:$@ .

ubuntu2204-gtk3:
docker build --build-arg UBUNTU_VERSION=22.04 --build-arg LIBGTK=libgtk-3-dev -t viking-build:$@ .

ubuntu2204-gtk2:
docker build --build-arg UBUNTU_VERSION=22.04 --build-arg LIBGTK=libgtk2.0-dev -t viking-build:$@ .