Add CI with GitHub Actions #2
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: | |
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 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 -o lang.lex.c lang.l | |
gcc -o brainrot lang.tab.c lang.lex.c -lfl | |
- name: Run Brainrot examples | |
run: | | |
./brainrot < examples/fizz_buzz.brainrot | |
./brainrot < examples/for_loop.brainrot | |
./brainrot < examples/hello_world.brainrot | |
./brainrot < examples/output_error.brainrot | |
./brainrot < examples/switch_case.brainrot |