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

Added build & test on Fedora 34

* 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
parent ffda9177
---
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
---
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 }}
......@@ -2,5 +2,6 @@
runs:
using: composite
steps:
- run: sudo apt --yes update
- name: Update installed packages
run: sudo apt --yes update
shell: bash
......@@ -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,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 }}/..
---
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
---
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
---
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 }}
---
runs:
using: composite
steps:
- name: Update installed packages
run: yum --assumeyes update
shell: bash
---
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
---
name: CI Pipeline
name: Build & Test (Ubuntu Latest)
on:
pull_request:
......@@ -16,113 +16,31 @@ env:
libglib2.0-dev
libiniparser-dev
libmapnik-dev
libmemcached-dev
librados-dev
jobs:
lint-astyle:
name: Lint code with `astyle`
build-and-test:
name: Build & Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Update installed packages
uses: ./.github/actions/apt/update
- name: Install `astyle`
uses: ./.github/actions/apt/install
- name: Provision environment
uses: ./.github/actions/apt/provision
with:
packages: 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 ""
git diff
exit -1
fi
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Update installed packages
uses: ./.github/actions/apt/update
- name: Install build dependencies
uses: ./.github/actions/apt/install
with:
packages: ${{ env.build-dependencies }}
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: Create build archive
uses: ./.github/actions/build-archive/create
- name: Upload build archive
uses: actions/upload-artifact@v2
with:
name: build-archive
path: /tmp/workspace.tar.zst
test-make-test:
name: Test with `make test`
runs-on: ubuntu-latest
needs:
- build
- lint-astyle
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Update installed packages
uses: ./.github/actions/apt/update
- name: Install build dependencies
uses: ./.github/actions/apt/install
with:
packages: ${{ env.build-dependencies }}
- name: Download build archive
uses: actions/download-artifact@v2
with:
name: build-archive
path: /tmp
- name: Extract build archive
uses: ./.github/actions/build-archive/extract
- 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: Checkout code
uses: actions/checkout@v2
- name: Update installed packages
uses: ./.github/actions/apt/update
- name: Install build & test dependencies
uses: ./.github/actions/apt/install
with:
packages: ${{ env.build-dependencies }} apache2 libjs-leaflet
- name: Download build archive
uses: actions/download-artifact@v2
with:
name: build-archive
path: /tmp
- name: Extract build archive
uses: ./.github/actions/build-archive/extract
- name: Configure Apache HTTP Server
run: |
sudo mkdir --parents /run/renderd /var/cache/renderd/tiles
......@@ -154,5 +72,5 @@ jobs:
- name: Test Apache HTTP Server `mod_tile` module
run: |
curl --silent http://localhost/renderd-example/tiles/9/297/191.png \
| sha256sum - \
| grep dbf26531286e844a3a9735cdd193598dca78d22f77cafe5824bcaf17f88cbb08
| sha224sum - \
| grep 9cd82e5af9d9002a1c75126ebdb7bf054ec0b7ed0db228dfb0a09bae
---
name: Lint
on:
pull_request:
push:
branches:
- master
- develop
jobs:
astyle:
name: Lint with `astyle`
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Provision environment
uses: ./.github/actions/apt/provision
with:
packages: 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 ""
git diff
exit -1
fi
This diff is collapsed.
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