-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CPack packaging to GitHub Actions (#406)
- Loading branch information
1 parent
0aa7607
commit d9dbf82
Showing
13 changed files
with
119 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Set `CPACK_PACKAGE_FILE_NAME` | ||
run: | | ||
echo "CPACK_PACKAGE_FILE_NAME=mod_tile-${GITHUB_SHA}-$(echo ${{ matrix.image || matrix.os || matrix.box_generic || github.job }}-${{ matrix.compiler }} | sed 's/[^0-9a-zA-Z-]/_/g')" >> ${GITHUB_ENV} | ||
shell: bash --noprofile --norc -euxo pipefail {0} | ||
|
||
- name: Set `CPACK_OPTIONS` | ||
run: | | ||
if command -v dpkg; then | ||
echo "CPACK_OPTIONS= -G DEB" >> ${GITHUB_ENV} | ||
elif command -v rpm; then | ||
echo "CPACK_OPTIONS=-G RPM" >> ${GITHUB_ENV} | ||
elif [ -f /etc/os-release ]; then | ||
source /etc/os-release | ||
if [ "$ID" = "freebsd" ]; then | ||
echo "CPACK_OPTIONS=-D CPACK_FREEBSD_PACKAGE_LICENSE=GPLv2 -D CPACK_SET_DESTDIR=1 -G FREEBSD" >> ${GITHUB_ENV} | ||
fi | ||
elif [[ ${OSTYPE} == 'darwin'* ]]; then | ||
echo "CPACK_OPTIONS=-D CPACK_SET_DESTDIR=1 -G DragNDrop" >> ${GITHUB_ENV} | ||
else | ||
echo "CPACK_OPTIONS=-D CPACK_SET_DESTDIR=1 -G TGZ" >> ${GITHUB_ENV} | ||
fi | ||
shell: bash --noprofile --norc -euxo pipefail {0} | ||
|
||
- name: Package `mod_tile` | ||
run: | | ||
${{ !matrix.image && 'sudo' || '' }} cpack ${CPACK_OPTIONS} \ | ||
-D CPACK_PACKAGE_CONTACT="GitHub Actions" \ | ||
-D CPACK_PACKAGE_FILE_NAME="${CPACK_PACKAGE_FILE_NAME}" || true | ||
shell: bash --noprofile --norc -euxo pipefail {0} | ||
working-directory: build | ||
|
||
- name: Upload `mod_tile` package artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
if-no-files-found: ignore | ||
name: Package Artifacts - ${{ env.CPACK_PACKAGE_FILE_NAME }}${{ matrix.mapnik_latest && ' (Latest Mapnik)' || '' }} | ||
path: | | ||
build/${{ env.CPACK_PACKAGE_FILE_NAME }}.* | ||
retention-days: 14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
--- | ||
inputs: | ||
genhtml-extra-options: | ||
default: "" | ||
lcov-extra-options: | ||
default: "" | ||
|
||
|
@@ -19,10 +21,39 @@ runs: | |
"${GITHUB_WORKSPACE}/includes/*" \ | ||
"${GITHUB_WORKSPACE}/tests/*" \ | ||
"/usr/*" | ||
working-directory: build | ||
shell: bash --noprofile --norc -euxo pipefail {0} | ||
working-directory: build | ||
|
||
- name: Report `mod_tile` coverage results to `codecov.io` | ||
uses: codecov/[email protected] | ||
with: | ||
files: build/coverage.info | ||
|
||
- name: Write `mod_tile` coverage summary to `$GITHUB_STEP_SUMMARY` | ||
run: | | ||
lcov ${{ inputs.lcov-extra-options }} \ | ||
--summary \ | ||
coverage.info | sed 's/^ /* /g' >> ${GITHUB_STEP_SUMMARY} | ||
shell: bash --noprofile --norc -euxo pipefail {0} | ||
working-directory: build | ||
|
||
- name: Generate `mod_tile` coverage artifacts | ||
run: | | ||
genhtml ${{ inputs.genhtml-extra-options }} \ | ||
--output-directory coverage \ | ||
coverage.info | ||
shell: bash --noprofile --norc -euxo pipefail {0} | ||
working-directory: build | ||
|
||
- name: Set `COVERAGE_ARTIFACT_NAME` | ||
run: | | ||
echo "COVERAGE_ARTIFACT_NAME=$(echo ${{ matrix.image || matrix.os || matrix.box_generic || github.job }}-${{ matrix.compiler }} | sed 's/[^0-9a-zA-Z-]/_/g')" >> ${GITHUB_ENV} | ||
shell: bash --noprofile --norc -euxo pipefail {0} | ||
|
||
- name: Upload `mod_tile` coverage artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Coverage Artifacts - ${{ env.COVERAGE_ARTIFACT_NAME }}${{ matrix.mapnik_latest && ' (Latest Mapnik)' || '' }} | ||
path: | | ||
build/coverage | ||
build/coverage.info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,9 +77,15 @@ jobs: | |
if: | | ||
matrix.build_system == 'CMake' && | ||
matrix.compiler != 'LLVM' && | ||
matrix.image != 'debian:testing' && | ||
matrix.image != 'opensuse/leap:15' && | ||
matrix.image != 'ubuntu:rolling' | ||
- name: Package `mod_tile` | ||
uses: ./.github/actions/cmake/package | ||
if: | | ||
matrix.build_system == 'CMake' | ||
- name: Install `mod_tile` | ||
uses: ./.github/actions/install | ||
|
||
|
@@ -127,6 +133,11 @@ jobs: | |
uses: ./.github/actions/coverage | ||
if: matrix.build_system == 'CMake' | ||
|
||
- name: Package `mod_tile` | ||
uses: ./.github/actions/cmake/package | ||
if: | | ||
matrix.build_system == 'CMake' | ||
- name: Install `mod_tile` | ||
uses: ./.github/actions/install | ||
|
||
|
@@ -182,9 +193,15 @@ jobs: | |
- name: Process & Report `mod_tile` coverage results | ||
uses: ./.github/actions/coverage | ||
with: | ||
genhtml-extra-options: --ignore-errors inconsistent --ignore-errors unmapped | ||
lcov-extra-options: --ignore-errors gcov --ignore-errors inconsistent | ||
if: matrix.build_system == 'CMake' | ||
|
||
- name: Package `mod_tile` | ||
uses: ./.github/actions/cmake/package | ||
if: | | ||
matrix.build_system == 'CMake' | ||
- name: Install `mod_tile` | ||
uses: ./.github/actions/install | ||
|
||
|
@@ -224,8 +241,8 @@ jobs: | |
|
||
- name: Set `BUILD_PARALLEL_LEVEL` & `TEST_PARALLEL_LEVEL` | ||
run: | | ||
echo "BUILD_PARALLEL_LEVEL=$(nproc)" >> "$GITHUB_ENV" | ||
echo "TEST_PARALLEL_LEVEL=$(nproc)" >> "$GITHUB_ENV" | ||
echo "BUILD_PARALLEL_LEVEL=$(nproc)" >> ${GITHUB_ENV} | ||
echo "TEST_PARALLEL_LEVEL=$(nproc)" >> ${GITHUB_ENV} | ||
- name: Provision VM | ||
uses: hummeltech/[email protected] | ||
|
@@ -253,5 +270,8 @@ jobs: | |
- name: Process & Report `mod_tile` coverage results | ||
uses: ./.github/actions/coverage | ||
|
||
- name: Package `mod_tile` | ||
uses: ./.github/actions/cmake/package | ||
|
||
- name: Install `mod_tile` | ||
uses: ./.github/actions/install |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters