Skip to content

Merge pull request #61 from autiinpu2/fork_fix #188

Merge pull request #61 from autiinpu2/fork_fix

Merge pull request #61 from autiinpu2/fork_fix #188

name: check-quality
on: [push]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
Ubuntu:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install System Dependencies
run: |
sudo apt-get update
sudo apt-get install -y libreadline-dev
- name: Install Norminette
run: |
python3 -m pip install --upgrade pip
pip install norminette
- name: Norminette
run: |
norminette . > norm.log || true
cat norm.log
if grep "Error:" norm.log | grep -v -E "Global variable|WRONG_SCOPE_VAR" > filtered_errors.log; then
echo "❌ Norminette Errors Found:"
cat filtered_errors.log
exit 1
else
echo "✅ Norminette Success"
fi
- name: Compilation
run: |
make
make clean
make fclean
make re
- name: Basic tests
run: |
# TEST 1 : CTRL + D (EOF)
timeout 2s ./minishell < /dev/null
# TEST 2 : Simple Command + Args
echo "ls -la" | timeout 2s ./minishell
# TEST 3 : Absolute Path
echo "/bin/ls" | timeout 2s ./minishell
# TEST 4 : Environment Variable
echo "env " | timeout 2s ./minishell
# TEST 5 : Pipe
echo "ls | cat -e" | timeout 2s ./minishell
Macos:
runs-on: macos-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Install System Dependencies
run: |
brew update
brew install readline coreutils
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Norminette
run: |
python3 -m pip install --upgrade pip
pip install norminette
- name: Norminette
run: |
norminette . > norm.log || true
if grep "Error:" norm.log | grep -v -E "Global variable|WRONG_SCOPE_VAR" > filtered_errors.log; then
echo "❌ Norminette Errors Found:"
cat filtered_errors.log
exit 1
else
echo "✅ Norminette Success"
fi
- name: Compilation
run: make re
- name: Basic tests
run: |
gtimeout 2s ./minishell < /dev/null
echo "ls -la" | gtimeout 2s ./minishell
echo "/bin/ls" | gtimeout 2s ./minishell
echo "env" | gtimeout 2s ./minishell
echo "ls | cat -e" | gtimeout 2s ./minishell
Fedora:
runs-on: ubuntu-latest
container:
image: fedora:latest
continue-on-error: true
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install System Dependencies
run: |
# Fedora uses dnf. We need gcc and make for your 'Compilation' step.
dnf install -y readline-devel coreutils make gcc python3-pip python3-devel
- name: Install Norminette
run: |
python3 -m pip install --upgrade pip
python3 -m pip install norminette
- name: Run Norminette
run: |
# Running as a module ensures we use the version we just installed
python3 -m norminette . > norm.log || true
if grep "Error:" norm.log | grep -v -E "Global variable|WRONG_SCOPE_VAR" > filtered_errors.log; then
echo "❌ Norminette Errors Found:"
cat filtered_errors.log
exit 1
else
echo "✅ Norminette Success"
fi
- name: Compilation
run: |
make
make clean
make fclean
make re
- name: Functional Tests
run: |
# Using 'timeout' (Linux standard) instead of 'gtimeout'
timeout 2s ./minishell < /dev/null || echo "Shell exited"
echo "ls -la" | timeout 2s ./minishell
echo "/bin/ls" | timeout 2s ./minishell
echo "env" | timeout 2s ./minishell
echo "ls | cat -e" | timeout 2s ./minishell
Alpine:
runs-on: ubuntu-latest
container:
image: alpine:latest
continue-on-error: true
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install System Dependencies
run: |
apk update
# coreutils provides 'timeout', build-base provides 'make' and 'gcc'
apk add build-base readline-dev coreutils python3 py3-pip
- name: Install Norminette
run: |
python3 -m venv /opt/venv
/opt/venv/bin/pip install --upgrade pip
/opt/venv/bin/pip install norminette
# Link it so it's in the PATH
ln -s /opt/venv/bin/norminette /usr/bin/norminette
- name: Run Norminette
run: |
norminette . > norm.log || true
# Filter errors while ignoring specific 42-style quirks if needed
if grep "Error:" norm.log | grep -v -E "Global variable|WRONG_SCOPE_VAR" > filtered_errors.log; then
echo "❌ Norminette Errors Found:"
cat filtered_errors.log
exit 1
else
echo "✅ Norminette Success"
fi
- name: Compilation
run: |
make
# Checking if clean rules work
make clean
make fclean
make re
- name: Basic Functional Tests
run: |
# Using standard 'timeout' instead of 'gtimeout'
timeout 2s ./minishell < /dev/null || echo "Exited with $?"
echo "ls -la" | timeout 2s ./minishell
echo "/bin/ls" | timeout 2s ./minishell
echo "ls | cat -e" | timeout 2s ./minishell