name: Example

on:
  push:
    branches:
      - main
    paths:
      - 'examples/**'
      - '.github/workflows/example.yml'

  pull_request:
    paths:
      - 'examples/**'
      - '.github/workflows/example.yml'

jobs:
  build:
    name: Check examples
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4

    - name: Compile example-star.c
      run: |
        gcc -c -Wall -Werror -Iinclude examples/example-star.c

    - name: Compile example-high-z.c
      run: |
        gcc -c -Wall -Werror -Iinclude examples/example-high-z.c

    - name: Compile example-orbital.c
      run: |
        gcc -c -Wall -Werror -Iinclude examples/example-orbital.c

    - name: Compile example-time.c
      run: |
        gcc -c -Wall -Werror -Iinclude examples/example-time.c
        
    - name: Compile example-rise-set.c
      run: |
        gcc -c -Wall -Werror -Iinclude examples/example-rise-set.c
