mirror of
https://github.com/openstreetmap/mod_tile.git
synced 2025-07-25 15:04:30 +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
|
||||
- develop
|
||||
|
||||
env:
|
||||
build-dependencies: >-
|
||||
apache2-dev
|
||||
libcairo2-dev
|
||||
libcurl4-gnutls-dev
|
||||
libglib2.0-dev
|
||||
libiniparser-dev
|
||||
libmapnik-dev
|
||||
|
||||
jobs:
|
||||
lint-astyle:
|
||||
name: Lint code with `astyle`
|
||||
@ -16,9 +25,11 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: Update installed packages
|
||||
run: sudo apt --yes update
|
||||
uses: ./.github/actions/apt/update
|
||||
- name: Install `astyle`
|
||||
run: sudo apt --yes install astyle
|
||||
uses: ./.github/actions/apt/install
|
||||
with:
|
||||
packages: astyle
|
||||
- name: Run `astyle`
|
||||
run: |
|
||||
astyle \
|
||||
@ -46,12 +57,11 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: Update installed packages
|
||||
run: sudo apt --yes update
|
||||
uses: ./.github/actions/apt/update
|
||||
- name: Install build dependencies
|
||||
run: |
|
||||
sudo apt --yes install \
|
||||
apache2-dev libcairo2-dev libcurl4-gnutls-dev libglib2.0-dev \
|
||||
libiniparser-dev libmapnik-dev
|
||||
uses: ./.github/actions/apt/install
|
||||
with:
|
||||
packages: ${{ env.build-dependencies }}
|
||||
- name: Run `./autogen.sh`
|
||||
run: ./autogen.sh
|
||||
- name: Run `./configure`
|
||||
@ -59,14 +69,12 @@ jobs:
|
||||
- name: Run `make`
|
||||
run: make
|
||||
- name: Create build archive
|
||||
run: |
|
||||
tar --verbose --create --file=/tmp/workspace.tar \
|
||||
${{ github.workspace }}
|
||||
- name: Upload build artifacts
|
||||
uses: ./.github/actions/build-archive/create
|
||||
- name: Upload build archive
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: build
|
||||
path: /tmp/workspace.tar
|
||||
name: build-archive
|
||||
path: /tmp/workspace.tar.zst
|
||||
|
||||
test-make-test:
|
||||
name: Test with `make test`
|
||||
@ -75,20 +83,21 @@ jobs:
|
||||
- build
|
||||
- lint-astyle
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: Update installed packages
|
||||
run: sudo apt --yes update
|
||||
uses: ./.github/actions/apt/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: ./.github/actions/apt/install
|
||||
with:
|
||||
packages: ${{ env.build-dependencies }}
|
||||
- name: Download build archive
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: build
|
||||
name: build-archive
|
||||
path: /tmp
|
||||
- name: Extract build archive
|
||||
run: tar --verbose --extract --directory=/ --file=/tmp/workspace.tar
|
||||
uses: ./.github/actions/build-archive/extract
|
||||
- name: Run `make test`
|
||||
run: make test
|
||||
|
||||
@ -99,25 +108,22 @@ jobs:
|
||||
- build
|
||||
- lint-astyle
|
||||
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 libjs-leaflet
|
||||
- name: Install Apache HTTP Server
|
||||
run: |
|
||||
sudo apt --yes install \
|
||||
apache2
|
||||
- name: Download build artifacts
|
||||
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
|
||||
name: build-archive
|
||||
path: /tmp
|
||||
- name: Extract build archive
|
||||
run: tar --verbose --extract --directory=/ --file=/tmp/workspace.tar
|
||||
- name: Set up Apache HTTP Server
|
||||
uses: ./.github/actions/build-archive/extract
|
||||
- name: Configure Apache HTTP Server
|
||||
run: |
|
||||
sudo mkdir --parents /run/renderd /var/cache/renderd/tiles
|
||||
sudo ln --symbolic \
|
||||
|
Reference in New Issue
Block a user