Skip to content

Commit

Permalink
Added build & test on Fedora 34
Browse files Browse the repository at this point in the history
* Takes about 3-5 minutes

**Also:**
* Split up `Lint` and `Build & Test`
  * Into independent workflows
* Changed `.tar` compression to `GZip`
  * `--zstd` not available in `CentOS 7`
  * Also excluded `.git` & `.gitignore`
* Created `Provisioning` local action
  * Combining update & install steps, etc.
* Added libraries to `Ubuntu` build dependencies
  * `libmemcached-dev` & `librados-dev`
  * In order to test for successful compilation
* ~~Reduced `build-archive` retention to 1 day~~
* Updated `ax_pthread` macro
  * While trying to resolve `apxs` failure
  * http://www.gnu.org/software/autoconf-archive/ax_pthread.html
  • Loading branch information
hummeltech authored and pantierra committed Aug 2, 2021
1 parent ffda917 commit 7c4081d
Show file tree
Hide file tree
Showing 14 changed files with 653 additions and 288 deletions.
5 changes: 3 additions & 2 deletions .github/actions/apt/install/action.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
---
inputs:
packages:
description: List of packages to install
description: List of package(s) to install
required: true

runs:
using: composite
steps:
- run: sudo apt --yes install ${{ inputs.packages }}
- name: Install package(s)
run: sudo apt --yes install ${{ inputs.packages }}
shell: bash
15 changes: 15 additions & 0 deletions .github/actions/apt/provision/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
inputs:
packages:
description: List of package(s) to install
required: true

runs:
using: composite
steps:
- name: Update installed packages
uses: ./.github/actions/apt/update
- name: Install package(s)
uses: ./.github/actions/apt/install
with:
packages: ${{ inputs.packages }}
3 changes: 2 additions & 1 deletion .github/actions/apt/update/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
runs:
using: composite
steps:
- run: sudo apt --yes update
- name: Update installed packages
run: sudo apt --yes update
shell: bash
5 changes: 3 additions & 2 deletions .github/actions/build-archive/create/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ runs:
steps:
- name: Create build archive
run: |
tar --verbose --create --zstd \
--file=/tmp/workspace.tar.zst \
tar --verbose --create --gzip \
--exclude=.git --exclude=.gitgnore \
--file=/tmp/workspace.tar.gz \
*
shell: bash
working-directory: ${{ github.workspace }}/..
4 changes: 2 additions & 2 deletions .github/actions/build-archive/extract/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ runs:
steps:
- name: Extract build archive
run: |
tar --verbose --extract --zstd \
--file=/tmp/workspace.tar.zst
tar --verbose --extract --gzip \
--file=/tmp/workspace.tar.gz
shell: bash
working-directory: ${{ github.workspace }}/..
12 changes: 12 additions & 0 deletions .github/actions/yum/groups-install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
inputs:
groups:
description: List of group(s) to install
required: true

runs:
using: composite
steps:
- name: Install group(s)
run: yum --assumeyes groups install ${{ inputs.groups }}
shell: bash
12 changes: 12 additions & 0 deletions .github/actions/yum/install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
inputs:
packages:
description: List of package(s) to install
required: true

runs:
using: composite
steps:
- name: Install package(s)
run: yum --assumeyes install ${{ inputs.packages }}
shell: bash
24 changes: 24 additions & 0 deletions .github/actions/yum/provision/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
inputs:
groups:
description: List of group(s) to install
required: false
default: >-
"Development Tools"
packages:
description: List of package(s) to install
required: true

runs:
using: composite
steps:
- name: Update installed packages
uses: ./.github/actions/yum/update
- name: Install group(s)
uses: ./.github/actions/yum/groups-install
with:
groups: ${{ inputs.groups }}
- name: Install package(s)
uses: ./.github/actions/yum/install
with:
packages: ${{ inputs.packages }}
7 changes: 7 additions & 0 deletions .github/actions/yum/update/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
runs:
using: composite
steps:
- name: Update installed packages
run: yum --assumeyes update
shell: bash
94 changes: 94 additions & 0 deletions .github/workflows/build-and-test-fedora-34.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
name: Build & Test (Fedora 34)

on:
pull_request:
push:
branches:
- master
- develop

env:
build-group-dependencies: >-
"C Development Tools and Libraries"
"Development Libraries"
"Development Tools"
build-dependencies: >-
cairo-devel
glib2-devel
httpd-devel
iniparser-devel
libcurl-devel
libmemcached-devel
librados-devel
mapnik-devel
jobs:
build-and-test:
name: Build & Test
runs-on: ubuntu-latest
container:
image: fedora:34
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Provision environment
uses: ./.github/actions/yum/provision
with:
groups: ${{ env.build-group-dependencies }}
packages: ${{ env.build-dependencies }} httpd
- name: Run `./autogen.sh`
run: ./autogen.sh
- name: Run `./configure`
run: ./configure
- name: Run `make`
run: make
- name: Run `make test`
run: make test
- name: Configure Apache HTTP Server
run: |
mkdir --parents /usr/share/javascript/leaflet
curl --silent \
"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.js" \
> /usr/share/javascript/leaflet/leaflet.min.js
curl --silent \
"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.css" \
> /usr/share/javascript/leaflet/leaflet.css
mkdir --parents /run/renderd /var/cache/renderd/tiles
ln --symbolic \
"${PWD}/utils/example-map" \
/var/www/
ln --symbolic \
/usr/share/javascript/leaflet \
/var/www/example-map/leaflet
ln --symbolic \
"${PWD}/etc/renderd/renderd.conf.examples" \
/etc/renderd.conf
ln --symbolic \
"${PWD}/etc/apache2/renderd.conf" \
/etc/httpd/conf.d/renderd.conf
ln --symbolic \
"${PWD}/etc/apache2/renderd-example-map.conf" \
/etc/httpd/conf.d/renderd-example-map.conf
echo "LoadModule tile_module /usr/lib64/httpd/modules/mod_tile.so" \
| tee --append /etc/httpd/conf.modules.d/11-mod_tile.conf
sed --in-place \
"s#/usr/lib/mapnik/3.0/input#/usr/lib64/mapnik/input#g" \
/etc/renderd.conf
sed --in-place \
"s#/usr/share/fonts/truetype#/usr/share/fonts#g" \
/etc/renderd.conf
rm --force /etc/httpd/conf.d/welcome.conf
- name: Run `make install`
run: make install
- name: Run `make install-mod_tile`
run: make install-mod_tile
- name: Start `renderd`
run: renderd
- name: Start Apache HTTP Server
run: httpd
- name: Test Apache HTTP Server `mod_tile` module
run: |
curl --silent http://localhost/renderd-example/tiles/9/297/191.png \
| sha224sum - \
| grep 9cd82e5af9d9002a1c75126ebdb7bf054ec0b7ed0db228dfb0a09bae
76 changes: 76 additions & 0 deletions .github/workflows/build-and-test-ubuntu-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
name: Build & Test (Ubuntu Latest)

on:
pull_request:
push:
branches:
- master
- develop

env:
build-dependencies: >-
apache2-dev
libcairo2-dev
libcurl4-gnutls-dev
libglib2.0-dev
libiniparser-dev
libmapnik-dev
libmemcached-dev
librados-dev
jobs:
build-and-test:
name: Build & Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Provision environment
uses: ./.github/actions/apt/provision
with:
packages: >-
${{ env.build-dependencies }}
apache2
libjs-leaflet
- name: Run `./autogen.sh`
run: ./autogen.sh
- name: Run `./configure`
run: ./configure
- name: Run `make`
run: make
- name: Run `make test`
run: make test
- name: Configure Apache HTTP Server
run: |
sudo mkdir --parents /run/renderd /var/cache/renderd/tiles
sudo ln --symbolic \
"${PWD}/utils/example-map" \
/var/www/
sudo ln --symbolic \
/usr/share/javascript/leaflet \
/var/www/example-map/leaflet
sudo ln --symbolic \
"${PWD}/etc/renderd/renderd.conf.examples" \
/etc/renderd.conf
sudo ln --symbolic \
"${PWD}/etc/apache2/renderd.conf" \
/etc/apache2/conf-enabled/renderd.conf
sudo ln --symbolic \
"${PWD}/etc/apache2/renderd-example-map.conf" \
/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 \
| sha224sum - \
| grep 9cd82e5af9d9002a1c75126ebdb7bf054ec0b7ed0db228dfb0a09bae
Loading

0 comments on commit 7c4081d

Please sign in to comment.