feat: add a tab to Intent Log and add selectable text with tooltip #43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| tags: | |
| - 'v[0-9]+.[0-9]+.[0-9]+*' | |
| pull_request: | |
| branches: [ "main" ] | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Koka (Unix) | |
| if: runner.os != 'Windows' | |
| run: | | |
| curl -sSL https://github.com/koka-lang/koka/releases/latest/download/install.sh | sudo sh | |
| echo "$HOME/.local/bin" >> "$GITHUB_PATH" | |
| - name: Install Koka (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| curl -sSL -o "$env:TEMP\install-koka.bat" https://github.com/koka-lang/koka/releases/latest/download/install.bat | |
| & "$env:TEMP\install-koka.bat" | |
| "$env:LOCALAPPDATA\koka\bin" | Out-File -Append -FilePath $env:GITHUB_PATH | |
| - name: Install Hica (Unix) | |
| if: runner.os != 'Windows' | |
| run: | | |
| curl -fsSL https://www.hica.dev/install.sh | sh | |
| echo "$HOME/.local/bin" >> "$GITHUB_PATH" | |
| - name: Install Hica (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| curl -fsSL -o "$env:TEMP\install-hica.ps1" https://www.hica.dev/install.ps1 | |
| & "$env:TEMP\install-hica.ps1" | |
| "$env:LOCALAPPDATA\hica" | Out-File -Append -FilePath $env:GITHUB_PATH | |
| - name: Verify tools | |
| run: | | |
| koka --version | |
| hica --version | |
| shell: bash | |
| - name: Run tests | |
| shell: bash | |
| continue-on-error: ${{ runner.os == 'Windows' }} | |
| run: | | |
| set +e | |
| for f in tests/test_*.hc; do | |
| result=$(hica test "$f" 2>&1 | grep -E "passed|failed|error") | |
| echo "$(basename $f): $result" | |
| done | |
| build: | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| needs: test | |
| strategy: | |
| matrix: | |
| include: | |
| - os: macos-latest | |
| artifact: tbdflow-ui-macos-arm64 | |
| imgui_asset: libimgui_hica-macos-arm64.a | |
| - os: ubuntu-latest | |
| artifact: tbdflow-ui-linux-x86_64 | |
| imgui_asset: libimgui_hica-linux-x86_64.a | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install SDL2 (macOS) | |
| if: runner.os == 'macOS' | |
| run: brew install sdl2 | |
| - name: Install SDL2 (Linux) | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y libsdl2-dev | |
| - name: Install Koka | |
| run: | | |
| curl -sSL https://github.com/koka-lang/koka/releases/latest/download/install.sh | sudo sh | |
| echo "$HOME/.local/bin" >> "$GITHUB_PATH" | |
| - name: Install Hica | |
| run: | | |
| curl -fsSL https://www.hica.dev/install.sh | sh | |
| echo "$HOME/.local/bin" >> "$GITHUB_PATH" | |
| - name: Download imgui library | |
| run: | | |
| curl -fsSL -o lib/libimgui_hica.a \ | |
| https://github.com/cladam/imgui/releases/latest/download/${{ matrix.imgui_asset }} | |
| - name: Patch link flags for Linux | |
| if: runner.os == 'Linux' | |
| run: | | |
| sed -i 's| --cclinkopts=-L/opt/homebrew/opt/sdl2/lib||g' hica.hml | |
| sed -i 's|--cclinkopts=-framework --cclinkopts=OpenGL|--cclinkopts=-lGL|g' hica.hml | |
| sed -i 's|--cclinkopts=-lc++|--cclinkopts=-lstdc++|g' hica.hml | |
| - name: Build binary | |
| run: hica build -o tbdflow-ui | |
| - name: Ad-hoc codesign (macOS) | |
| if: runner.os == 'macOS' | |
| run: codesign --sign - --force tbdflow-ui | |
| - name: Package | |
| run: tar czf ${{ matrix.artifact }}.tar.gz tbdflow-ui | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact }} | |
| path: ${{ matrix.artifact }}.tar.gz | |
| release: | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| needs: [test, build] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist/ | |
| merge-multiple: true | |
| - name: Create release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| files: | | |
| dist/* | |
| install.sh |