name: CI

on: [push, pull_request]

jobs:
  code-tests:
    strategy:
      matrix:
        platform: [x86, x64]
        os: [ubuntu-latest]
    runs-on: '${{ matrix.os }}'
    if: "!contains(github.event.head_commit.message, 'NO_CI')"
    name: 'code-tests: ${{ matrix.os }} / ${{ matrix.platform }}'
    steps:
      - name: Checkout
        uses: actions/checkout@main
        with:
          fetch-depth: 1
      - name: Set up GCC
        uses: egor-tensin/setup-gcc@v1
        with:
          version: latest
          platform: '${{ matrix.platform }}'
      - name: Install packages
        run: |
          sudo apt-get update
          sudo apt-get install curl libcurl4-openssl-dev
          sudo apt-get install libxml2 libxml2-dev
      - name: Run tests
        run: |
          chmod +x ./tests/test.sh
          ./tests/test.sh
  general_module_workflow_c:
    uses: Karaka-Management/Karaka/.github/workflows/c_template.yml@develop
    secrets:
      GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      GH_PAT: ${{ secrets.GH_PAT }}
      CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}