mirror of
https://github.com/openstreetmap/mod_tile.git
synced 2025-08-08 08:24:25 +00:00
Reduce redundant CI configuration by using local actions
This commit is contained in:

committed by
ǝɹʇʇɐʃǝ◖ xıʃǝɟ

parent
0f017f1ae8
commit
cab62c1612
11
.github/actions/apt/install/action.yml
vendored
Normal file
11
.github/actions/apt/install/action.yml
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
inputs:
|
||||||
|
packages:
|
||||||
|
description: List of packages to install
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- run: sudo apt --yes install ${{ inputs.packages }}
|
||||||
|
shell: bash
|
6
.github/actions/apt/update/action.yml
vendored
Normal file
6
.github/actions/apt/update/action.yml
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- run: sudo apt --yes update
|
||||||
|
shell: bash
|
11
.github/actions/build-archive/create/action.yml
vendored
Normal file
11
.github/actions/build-archive/create/action.yml
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Create build archive
|
||||||
|
run: |
|
||||||
|
tar --verbose --create --zstd \
|
||||||
|
--file=/tmp/workspace.tar.zst \
|
||||||
|
*
|
||||||
|
shell: bash
|
||||||
|
working-directory: ${{ github.workspace }}/..
|
10
.github/actions/build-archive/extract/action.yml
vendored
Normal file
10
.github/actions/build-archive/extract/action.yml
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Extract build archive
|
||||||
|
run: |
|
||||||
|
tar --verbose --extract --zstd \
|
||||||
|
--file=/tmp/workspace.tar.zst
|
||||||
|
shell: bash
|
||||||
|
working-directory: ${{ github.workspace }}/..
|
76
.github/workflows/github-actions.yml
vendored
76
.github/workflows/github-actions.yml
vendored
@ -8,6 +8,15 @@ on:
|
|||||||
- master
|
- master
|
||||||
- develop
|
- develop
|
||||||
|
|
||||||
|
env:
|
||||||
|
build-dependencies: >-
|
||||||
|
apache2-dev
|
||||||
|
libcairo2-dev
|
||||||
|
libcurl4-gnutls-dev
|
||||||
|
libglib2.0-dev
|
||||||
|
libiniparser-dev
|
||||||
|
libmapnik-dev
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint-astyle:
|
lint-astyle:
|
||||||
name: Lint code with `astyle`
|
name: Lint code with `astyle`
|
||||||
@ -16,9 +25,11 @@ jobs:
|
|||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Update installed packages
|
- name: Update installed packages
|
||||||
run: sudo apt --yes update
|
uses: ./.github/actions/apt/update
|
||||||
- name: Install `astyle`
|
- name: Install `astyle`
|
||||||
run: sudo apt --yes install astyle
|
uses: ./.github/actions/apt/install
|
||||||
|
with:
|
||||||
|
packages: astyle
|
||||||
- name: Run `astyle`
|
- name: Run `astyle`
|
||||||
run: |
|
run: |
|
||||||
astyle \
|
astyle \
|
||||||
@ -46,12 +57,11 @@ jobs:
|
|||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Update installed packages
|
- name: Update installed packages
|
||||||
run: sudo apt --yes update
|
uses: ./.github/actions/apt/update
|
||||||
- name: Install build dependencies
|
- name: Install build dependencies
|
||||||
run: |
|
uses: ./.github/actions/apt/install
|
||||||
sudo apt --yes install \
|
with:
|
||||||
apache2-dev libcairo2-dev libcurl4-gnutls-dev libglib2.0-dev \
|
packages: ${{ env.build-dependencies }}
|
||||||
libiniparser-dev libmapnik-dev
|
|
||||||
- name: Run `./autogen.sh`
|
- name: Run `./autogen.sh`
|
||||||
run: ./autogen.sh
|
run: ./autogen.sh
|
||||||
- name: Run `./configure`
|
- name: Run `./configure`
|
||||||
@ -59,14 +69,12 @@ jobs:
|
|||||||
- name: Run `make`
|
- name: Run `make`
|
||||||
run: make
|
run: make
|
||||||
- name: Create build archive
|
- name: Create build archive
|
||||||
run: |
|
uses: ./.github/actions/build-archive/create
|
||||||
tar --verbose --create --file=/tmp/workspace.tar \
|
- name: Upload build archive
|
||||||
${{ github.workspace }}
|
|
||||||
- name: Upload build artifacts
|
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: build
|
name: build-archive
|
||||||
path: /tmp/workspace.tar
|
path: /tmp/workspace.tar.zst
|
||||||
|
|
||||||
test-make-test:
|
test-make-test:
|
||||||
name: Test with `make test`
|
name: Test with `make test`
|
||||||
@ -75,20 +83,21 @@ jobs:
|
|||||||
- build
|
- build
|
||||||
- lint-astyle
|
- lint-astyle
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
- name: Update installed packages
|
- name: Update installed packages
|
||||||
run: sudo apt --yes update
|
uses: ./.github/actions/apt/update
|
||||||
- name: Install build dependencies
|
- name: Install build dependencies
|
||||||
run: |
|
uses: ./.github/actions/apt/install
|
||||||
sudo apt --yes install \
|
with:
|
||||||
apache2-dev libcairo2-dev libcurl4-gnutls-dev libglib2.0-dev \
|
packages: ${{ env.build-dependencies }}
|
||||||
libiniparser-dev libmapnik-dev
|
- name: Download build archive
|
||||||
- name: Download build artifacts
|
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: build
|
name: build-archive
|
||||||
path: /tmp
|
path: /tmp
|
||||||
- name: Extract build archive
|
- name: Extract build archive
|
||||||
run: tar --verbose --extract --directory=/ --file=/tmp/workspace.tar
|
uses: ./.github/actions/build-archive/extract
|
||||||
- name: Run `make test`
|
- name: Run `make test`
|
||||||
run: make test
|
run: make test
|
||||||
|
|
||||||
@ -99,25 +108,22 @@ jobs:
|
|||||||
- build
|
- build
|
||||||
- lint-astyle
|
- lint-astyle
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
- name: Update installed packages
|
- name: Update installed packages
|
||||||
run: sudo apt --yes update
|
uses: ./.github/actions/apt/update
|
||||||
- name: Install build dependencies
|
- name: Install build & test dependencies
|
||||||
run: |
|
uses: ./.github/actions/apt/install
|
||||||
sudo apt --yes install \
|
with:
|
||||||
apache2-dev libcairo2-dev libcurl4-gnutls-dev libglib2.0-dev \
|
packages: ${{ env.build-dependencies }} apache2 libjs-leaflet
|
||||||
libiniparser-dev libmapnik-dev libjs-leaflet
|
- name: Download build archive
|
||||||
- name: Install Apache HTTP Server
|
|
||||||
run: |
|
|
||||||
sudo apt --yes install \
|
|
||||||
apache2
|
|
||||||
- name: Download build artifacts
|
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: build
|
name: build-archive
|
||||||
path: /tmp
|
path: /tmp
|
||||||
- name: Extract build archive
|
- name: Extract build archive
|
||||||
run: tar --verbose --extract --directory=/ --file=/tmp/workspace.tar
|
uses: ./.github/actions/build-archive/extract
|
||||||
- name: Set up Apache HTTP Server
|
- name: Configure Apache HTTP Server
|
||||||
run: |
|
run: |
|
||||||
sudo mkdir --parents /run/renderd /var/cache/renderd/tiles
|
sudo mkdir --parents /run/renderd /var/cache/renderd/tiles
|
||||||
sudo ln --symbolic \
|
sudo ln --symbolic \
|
||||||
|
Reference in New Issue
Block a user