Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Integrate CI with the minishell tester #46

Merged
merged 5 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions .github/workflows/build.yml

This file was deleted.

57 changes: 57 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build and Test

on:
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository to incomming PR
uses: actions/checkout@v4

- name: Set up build environment
run: |
sudo apt-get update
sudo apt-get install -y build-essential valgrind

- name: Compile with Makefile
run: make

- name: Set up testing framework
run: |
git clone https://github.com/LeaYeh/42_minishell_tester.git
cp -r 42_minishell_tester $HOME
chmod +x $HOME/42_minishell_tester/tester.sh

- name: Check memory leaks and set up PR failed count
run: |
$HOME/42_minishell_tester/tester.sh vm
env:
GH_BRANCH: "PR_FAILED_COUNT"

- name: Set up main failed count
run: |
git pull origin main
git checkout main
$HOME/42_minishell_tester/tester.sh vm
itislu marked this conversation as resolved.
Show resolved Hide resolved
env:
GH_BRANCH: "MAIN_FAILED_COUNT"

- name: Compare failed count
run: |
echo "PR_FAILED_COUNT: $PR_FAILED_COUNT"
echo "MAIN_FAILED_COUNT: $MAIN_FAILED_COUNT"
if [ $PR_FAILED_COUNT -gt $MAIN_FAILED_COUNT ]; then
echo "PR_FAILED_COUNT is greater than MAIN_FAILED_COUNT"
exit 1
else
echo "PR_FAILED_COUNT is less than or equal to MAIN_FAILED_COUNT"
exit 0
fi
env:
PR_FAILED_COUNT: ${{ env.PR_FAILED_COUNT }}
MAIN_FAILED_COUNT: ${{ env.MAIN_FAILED_COUNT }}
Binary file added act
Binary file not shown.
Loading