Update README.md #4
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: Compile and Test C Program | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up GCC | |
| run: sudo apt-get install -y gcc | |
| - name: Compile C program | |
| run: gcc -o my_program main.c | |
| - name: Run tests | |
| run: | | |
| if ./my_program; then | |
| echo "Test Passed" | |
| else | |
| echo "Test Failed" | |
| exit 1 | |
| fi |