name: Alpine

on:
    push:
        paths-ignore:
            - 'doc/**'
    pull_request:
        paths-ignore:
            - 'doc/**'

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  cancel-in-progress: true

jobs:
  build:
    runs-on: ubuntu-latest
    if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
    defaults:
      run:
        shell: bash -l {0}
    strategy:
      fail-fast: true
    container: pdal/alpinebase:latest
    steps:
    - uses: actions/checkout@v4
    - name: Setup
      run: |
          source ./scripts/ci/alpine/setup.sh

    - name: CMake
      run: |
          source ../scripts/ci/alpine/cmake.sh
      working-directory: ./build

    - name: Compile
      run: |
          source ../scripts/ci/alpine/compile.sh
      working-directory: ./build

    - name: Test
      run: |
          source ../scripts/ci/alpine/test.sh
      working-directory: ./build

    - name: Examples
      run: |
          source ./scripts/ci/alpine/examples.sh
