pre-commit

add more hooks

add workflow
This commit is contained in:
Mathis Logemann 2022-08-11 20:56:08 +02:00
parent 9627432723
commit 88052447b9
2 changed files with 38 additions and 7 deletions

View file

@ -9,68 +9,83 @@ on:
- "**" - "**"
jobs: jobs:
checkSource:
name: Check Source Code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/action@v3.0.0
windows: windows:
needs: checkSource
name: Windows memory mapped name: Windows memory mapped
uses: ./.github/workflows/windows.yml uses: ./.github/workflows/windows.yml
with: with:
VCPKG_SHA: f6af75acc923c833a5620943e3fc7d5e4930f0df VCPKG_SHA: f6af75acc923c833a5620943e3fc7d5e4930f0df
NUGET_REGISTRY: https://nuget.pkg.github.com/mapnik/index.json NUGET_REGISTRY: https://nuget.pkg.github.com/mapnik/index.json
NUGET_USERNAME: mapnik NUGET_USERNAME: mapnik
USE_MEMORY_MAPPED_FILE: 'ON' USE_MEMORY_MAPPED_FILE: "ON"
secrets: secrets:
NUGET_REGISTRY_PAT: ${{ secrets.VCPKG_CACHE_PAT }} NUGET_REGISTRY_PAT: ${{ secrets.VCPKG_CACHE_PAT }}
windows-mmf-off: windows-mmf-off:
needs: checkSource
name: Windows file based name: Windows file based
uses: ./.github/workflows/windows.yml uses: ./.github/workflows/windows.yml
with: with:
VCPKG_SHA: f6af75acc923c833a5620943e3fc7d5e4930f0df VCPKG_SHA: f6af75acc923c833a5620943e3fc7d5e4930f0df
NUGET_REGISTRY: https://nuget.pkg.github.com/mapnik/index.json NUGET_REGISTRY: https://nuget.pkg.github.com/mapnik/index.json
NUGET_USERNAME: mapnik NUGET_USERNAME: mapnik
USE_MEMORY_MAPPED_FILE: 'OFF' USE_MEMORY_MAPPED_FILE: "OFF"
secrets: secrets:
NUGET_REGISTRY_PAT: ${{ secrets.VCPKG_CACHE_PAT }} NUGET_REGISTRY_PAT: ${{ secrets.VCPKG_CACHE_PAT }}
ubuntu: ubuntu:
needs: checkSource
name: Linux memory mapped name: Linux memory mapped
uses: ./.github/workflows/ubuntu.yml uses: ./.github/workflows/ubuntu.yml
with: with:
VCPKG_SHA: f6af75acc923c833a5620943e3fc7d5e4930f0df VCPKG_SHA: f6af75acc923c833a5620943e3fc7d5e4930f0df
NUGET_REGISTRY: https://nuget.pkg.github.com/mapnik/index.json NUGET_REGISTRY: https://nuget.pkg.github.com/mapnik/index.json
NUGET_USERNAME: mapnik NUGET_USERNAME: mapnik
USE_MEMORY_MAPPED_FILE: 'ON' USE_MEMORY_MAPPED_FILE: "ON"
secrets: secrets:
NUGET_REGISTRY_PAT: ${{ secrets.VCPKG_CACHE_PAT }} NUGET_REGISTRY_PAT: ${{ secrets.VCPKG_CACHE_PAT }}
ubuntu-mmf-off: ubuntu-mmf-off:
needs: checkSource
name: Linux file based name: Linux file based
uses: ./.github/workflows/ubuntu.yml uses: ./.github/workflows/ubuntu.yml
with: with:
VCPKG_SHA: f6af75acc923c833a5620943e3fc7d5e4930f0df VCPKG_SHA: f6af75acc923c833a5620943e3fc7d5e4930f0df
NUGET_REGISTRY: https://nuget.pkg.github.com/mapnik/index.json NUGET_REGISTRY: https://nuget.pkg.github.com/mapnik/index.json
NUGET_USERNAME: mapnik NUGET_USERNAME: mapnik
USE_MEMORY_MAPPED_FILE: 'OFF' USE_MEMORY_MAPPED_FILE: "OFF"
secrets: secrets:
NUGET_REGISTRY_PAT: ${{ secrets.VCPKG_CACHE_PAT }} NUGET_REGISTRY_PAT: ${{ secrets.VCPKG_CACHE_PAT }}
macos: macos:
needs: checkSource
name: MacOS memory mapped name: MacOS memory mapped
uses: ./.github/workflows/macos.yml uses: ./.github/workflows/macos.yml
with: with:
VCPKG_SHA: f6af75acc923c833a5620943e3fc7d5e4930f0df VCPKG_SHA: f6af75acc923c833a5620943e3fc7d5e4930f0df
NUGET_REGISTRY: https://nuget.pkg.github.com/mapnik/index.json NUGET_REGISTRY: https://nuget.pkg.github.com/mapnik/index.json
NUGET_USERNAME: mapnik NUGET_USERNAME: mapnik
USE_MEMORY_MAPPED_FILE: 'ON' USE_MEMORY_MAPPED_FILE: "ON"
secrets: secrets:
NUGET_REGISTRY_PAT: ${{ secrets.VCPKG_CACHE_PAT }} NUGET_REGISTRY_PAT: ${{ secrets.VCPKG_CACHE_PAT }}
macos-mmf-off: macos-mmf-off:
needs: checkSource
name: MacOS file based name: MacOS file based
uses: ./.github/workflows/macos.yml uses: ./.github/workflows/macos.yml
with: with:
VCPKG_SHA: f6af75acc923c833a5620943e3fc7d5e4930f0df VCPKG_SHA: f6af75acc923c833a5620943e3fc7d5e4930f0df
NUGET_REGISTRY: https://nuget.pkg.github.com/mapnik/index.json NUGET_REGISTRY: https://nuget.pkg.github.com/mapnik/index.json
NUGET_USERNAME: mapnik NUGET_USERNAME: mapnik
USE_MEMORY_MAPPED_FILE: 'OFF' USE_MEMORY_MAPPED_FILE: "OFF"
secrets: secrets:
NUGET_REGISTRY_PAT: ${{ secrets.VCPKG_CACHE_PAT }} NUGET_REGISTRY_PAT: ${{ secrets.VCPKG_CACHE_PAT }}

16
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,16 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: trailing-whitespace
files: ^.*\.cmake|CMakeLists\.txt$
- id: end-of-file-fixer
files: ^.*\.cmake|CMakeLists\.txt$
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v14.0.6
hooks:
- id: clang-format
types_or: [c++, c]