name: Makefile CI

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4

    - name: Setup
      run: |
        mkdir -p ~/bin ~/roms
        echo ~/bin >> $GITHUB_PATH

    - name: Install UXN
      run: |
        cd ~
        git clone https://git.sr.ht/~rabbits/uxn11
        cd uxn11
        make
        make install

    - name: Build TalOS
      run: make test

    - name: Upload TalOS
      uses: actions/upload-artifact@v4.3.4
      with:
        name: talos
        path: rom/*