Add break and continue loop control #79
Workflow file for this run
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
| # Build and test the Melt language (C++ interpreter) | |
| # Uses CMake only (no Make). Runs on Linux and macOS with GCC and Clang. | |
| # NOTE: This workflow does NOT use actions/checkout so submodules are never fetched. | |
| name: Build and Test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| build-and-test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| cxx: g++ | |
| - os: ubuntu-latest | |
| cxx: clang++ | |
| - os: macos-latest | |
| cxx: clang++ | |
| steps: | |
| - name: Checkout repository (no submodules) | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git init | |
| git remote add origin "https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git" | |
| git fetch --depth 1 origin "${{ github.sha }}":refs/heads/ci | |
| git checkout ci | |
| - name: Install dependencies (Ubuntu) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y cmake build-essential pkg-config \ | |
| libsdl2-dev libsqlite3-dev libqrencode-dev | |
| - name: Install dependencies (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| brew install cmake pkg-config sdl2 sqlite qrencode | |
| - name: Configure (CMake) | |
| run: | | |
| mkdir -p build | |
| cd build | |
| cmake .. -DUSE_MYSQL=OFF -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} | |
| - name: Build (CMake) | |
| run: | | |
| cd build | |
| cmake --build . | |
| - name: Test — run built-in demo (no args) | |
| run: ./build/melt | |
| - name: Set binary artifact name | |
| id: artifact | |
| run: | | |
| case "${{ matrix.os }}" in | |
| ubuntu-latest) echo "name=melt-linux-x86_64-${{ matrix.cxx }}" >> "$GITHUB_OUTPUT" ;; | |
| macos-latest) echo "name=melt-darwin-$(uname -m)-${{ matrix.cxx }}" >> "$GITHUB_OUTPUT" ;; | |
| *) echo "name=melt-${{ matrix.os }}-${{ matrix.cxx }}" >> "$GITHUB_OUTPUT" ;; | |
| esac | |
| - name: Upload melt binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ steps.artifact.outputs.name }} | |
| path: build/melt | |
| retention-days: 30 |