Merge pull request #75 from Brainrotlang/feat/array_expression #106
This file contains 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: Brainrot CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: ["main"] | |
paths-ignore: | |
- "**/*.md" | |
- "CODEOWNERS" | |
- "Makefile" | |
pull_request: | |
branches: ["main"] | |
paths-ignore: | |
- "**/*.md" | |
- "CODEOWNERS" | |
- "Makefile" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install build dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install gcc flex bison libfl-dev -y | |
- name: Build Brainrot | |
run: | | |
bison -d -Wcounterexamples lang.y -o lang.tab.c | |
flex lang.l | |
gcc -o brainrot lang.tab.c lex.yy.c ast.c -lfl -lm | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: brainrot | |
path: brainrot | |
test: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Download Brainrot artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: brainrot | |
- name: Grant execute permissions to Brainrot | |
run: chmod +x brainrot | |
- name: Install Python and dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install python3 python3-pip -y | |
python3 -m venv .venv | |
source .venv/bin/activate | |
pip install -r requirements.txt | |
working-directory: tests | |
- name: Run Pytest | |
run: | | |
source .venv/bin/activate | |
pytest -v test_brainrot.py | |
working-directory: tests |