name: Build

on: 
  push:
    branches:
      - main
    paths:
      - 'src/**'
      - 'include/**'
      - 'tools/src/**'
      - 'Makefile'
      - '*.mk'
      - '.github/workflows/build.yml'

  pull_request:
    paths:
      - 'src/**'
      - 'include/**'
      - 'tools/src/**'
      - 'Makefile'
      - '*.mk'
      - '.github/workflows/build.yml'

jobs:

  build:
    runs-on: ubuntu-latest
    env:
      CC: gcc
      CFLAGS: -Os -Wall -Werror
      CSTANDARD: c99
      WEXTRA: 1
      FORTIFY: 3
    steps:
    - uses: actions/checkout@v4

    - name: Build static library
      run: make static

    - name: Build shared library
      run: make shared

    - name: Compile solsys variants
      run: make solsys

    - name: Generate CIO locator data
      run: make cio_file
