Commit 0169d767 authored by David Hummel's avatar David Hummel Committed by ǝɹʇʇɐʃǝ◖ xıʃǝɟ
Browse files

Install, configure & start `apache` & `renderd`, test for `mod_tile.so`

parent f28cda99
name: CI pipeline
---
name: CI Pipeline
on:
pull_request:
push:
branches:
- master
- develop
jobs:
ci:
lint-astyle:
name: Lint code with `astyle`
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: update packages
run: sudo apt -y update
- name: install linter
run: sudo apt -y install astyle
- name: run linter
run: astyle --options=none --lineend=linux --style=1tbs --indent=force-tab=8 --break-blocks --indent-switches --pad-oper --pad-header --unpad-paren --suffix=none includes/* src/*
- name: check code format
run: >
- name: Checkout code
uses: actions/checkout@v2
- name: Update installed packages
run: sudo apt --yes update
- name: Install `astyle`
run: sudo apt --yes install astyle
- name: Run `astyle`
run: |
astyle \
--options=none --lineend=linux --style=1tbs --indent=force-tab=8 \
--break-blocks --indent-switches --pad-oper --pad-header \
--unpad-paren --suffix=none \
includes/* src/*
- name: Check if any modifications were made by `astyle`
run: |
if [[ -n $(git diff) ]]; then
echo "You must run 'astyle --options=none --lineend=linux --style=1tbs --indent=force-tab=8 --break-blocks --indent-switches --pad-oper --pad-header --unpad-paren --suffix=none includes/* src/*' before submitting a pull request"
echo "You must run 'astyle \
--options=none --lineend=linux --style=1tbs --indent=force-tab=8 \
--break-blocks --indent-switches --pad-oper --pad-header \
--unpad-paren --suffix=none \
includes/* src/*' before submitting a pull request"
echo ""
git diff
exit -1
fi
- name: install dependencies
run: sudo apt -y install apache2-dev libcairo2-dev libcurl4-gnutls-dev libglib2.0-dev libiniparser-dev libmapnik-dev
- name: autogen
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Update installed packages
run: sudo apt --yes update
- name: Install build dependencies
run: |
sudo apt --yes install \
apache2-dev libcairo2-dev libcurl4-gnutls-dev libglib2.0-dev \
libiniparser-dev libmapnik-dev
- name: Run `./autogen.sh`
run: ./autogen.sh
- name: configure
- name: Run `./configure`
run: ./configure
- name: make
- name: Run `make`
run: make
- name: make test
- name: Create build archive
run: |
tar --verbose --create --file=/tmp/workspace.tar \
${{ github.workspace }}
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: build
path: /tmp/workspace.tar
test-make-test:
name: Test with `make test`
runs-on: ubuntu-latest
needs:
- build
- lint-astyle
steps:
- name: Update installed packages
run: sudo apt --yes update
- name: Install build dependencies
run: |
sudo apt --yes install \
apache2-dev libcairo2-dev libcurl4-gnutls-dev libglib2.0-dev \
libiniparser-dev libmapnik-dev
- name: Download build artifacts
uses: actions/download-artifact@v2
with:
name: build
path: /tmp
- name: Extract build archive
run: tar --verbose --extract --directory=/ --file=/tmp/workspace.tar
- name: Run `make test`
run: make test
test-mod_tile-module:
name: Test `mod_tile` module
runs-on: ubuntu-latest
needs:
- build
- lint-astyle
steps:
- name: Update installed packages
run: sudo apt --yes update
- name: Install build dependencies
run: |
sudo apt --yes install \
apache2-dev libcairo2-dev libcurl4-gnutls-dev libglib2.0-dev \
libiniparser-dev libmapnik-dev
- name: Install Apache HTTP Server
run: |
sudo apt --yes install \
apache2
- name: Download build artifacts
uses: actions/download-artifact@v2
with:
name: build
path: /tmp
- name: Extract build archive
run: tar --verbose --extract --directory=/ --file=/tmp/workspace.tar
- name: Set up Apache HTTP Server
run: |
sudo mkdir --parents /run/renderd /var/cache/renderd/tiles
mkdir --parents examples/example-map/leaflet
curl --silent "https://unpkg.com/leaflet@1.7.1/dist/leaflet.js" \
> examples/example-map/leaflet/leaflet.min.js
curl --silent "https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" \
> examples/example-map/leaflet/leaflet.css
sudo ln --symbolic \
"${PWD}/examples/example-map" \
/var/www/
sudo ln --symbolic \
"${PWD}/examples/config/renderd/renderd.conf.dist" \
/etc/renderd.conf
sudo ln --symbolic \
"${PWD}/examples/config/apache2/renderd.conf.dist" \
/etc/apache2/conf-enabled/renderd.conf
sudo ln --symbolic \
"${PWD}/examples/config/apache2/renderd-example-map.conf.dist" \
/etc/apache2/conf-enabled/renderd-example-map.conf
echo "LoadModule tile_module /usr/lib/apache2/modules/mod_tile.so" \
| sudo tee --append /etc/apache2/mods-enabled/mod_tile.load
- name: Run `sudo make install`
run: sudo make install
- name: Run `make install-mod_tile`
run: sudo make install-mod_tile
- name: Start `renderd`
run: sudo renderd
- name: Enable & start Apache HTTP Server
run: sudo systemctl --now enable apache2
- name: Test Apache HTTP Server `mod_tile` module
run: |
curl --silent http://localhost/renderd-example/tiles/9/297/191.png \
| sha256sum - \
| grep dbf26531286e844a3a9735cdd193598dca78d22f77cafe5824bcaf17f88cbb08
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment