Skip to content

Build and Test

Build and Test #1246

Workflow file for this run

name: Build and Test
on:
schedule:
- cron: "0 */6 * * *"
push:
branches-ignore:
- "no-ci-*"
pull_request:
branches:
- "**"
workflow_dispatch:
env:
VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,readwrite"
VCPKG_NUGET_REPOSITORY: https://github.com/mapnik/vcpkg-cache.git
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["windows-latest", "ubuntu-latest", "macos-latest"]
include:
- os: "windows-latest"
mono: ""
preset: "windows-ci"
- os: "ubuntu-latest"
mono: "mono"
preset: "linux-ci"
- os: "macos-latest"
mono: "mono"
preset: "macos-ci"
steps:
- name: "Install required system packages"
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
choco install ninja
elif [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install -y gperf libxxf86vm-dev ninja-build autoconf-archive
else
brew install automake ninja autoconf-archive
fi
- uses: ilammy/msvc-dev-cmd@v1
- name: checkout repo
uses: actions/checkout@v3
with:
submodules: "recursive"
- name: checkout vcpkg
uses: actions/checkout@v3
with:
repository: "microsoft/vcpkg"
ref: b4a3d89125e45bc8f80fb94bef9761d4f4e14fb9
path: vcpkg
- name: "Setup vcpkg"
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
./vcpkg/bootstrap-vcpkg.bat
else
./vcpkg/bootstrap-vcpkg.sh
fi
- name: "Setup NuGet Credentials"
if: ${{ !(github.event_name == 'pull_request' || github.repository != 'mapnik/gh-actions-test') }}
shell: "bash"
run: >
${{ matrix.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
sources add
-source "https://nuget.pkg.github.com/mapnik/index.json"
-storepasswordincleartext
-name "GitHub"
-username "mapnik"
-password "${{ secrets.VCPKG_CACHE_PAT }}"
- name: "Setup NuGet apikey"
if: ${{ !(github.event_name == 'pull_request' || github.repository != 'mapnik/gh-actions-test') }}
shell: "bash"
run: >
${{ matrix.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
setapikey "${{ secrets.VCPKG_CACHE_PAT }}" -Source "https://nuget.pkg.github.com/mapnik/index.json"
- name: "Setup NuGet Credentials READONLY"
if: ${{ github.event_name == 'pull_request' || github.repository != 'mapnik/gh-actions-test' }}
shell: "bash"
run: >
${{ matrix.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
sources add
-source "https://nuget.pkg.github.com/mapnik/index.json"
-storepasswordincleartext
-name "GitHub"
-username "${{ github.actor }}"
-password "${{ secrets.GITHUB_TOKEN }}"
- name: "Setup NuGet apikey READONLY"
if: ${{ github.event_name == 'pull_request' || github.repository != 'mapnik/gh-actions-test' }}
shell: "bash"
run: >
${{ matrix.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
setapikey "${{ secrets.GITHUB_TOKEN }}" -Source "https://nuget.pkg.github.com/mapnik/index.json"
- name: Configure CMake
run: cmake --preset=${{ matrix.preset }}
- uses: actions/upload-artifact@v3
if: failure()
with:
name: logs
path: vcpkg/buildtrees/*/*.log
retention-days: 2