ft_libft CI test #66
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: CI | |
run-name: ft_libft CI test | |
on: | |
push: | |
branches: [main] | |
paths: | |
- '**.c' | |
- '**.h' | |
- Makefile | |
- '**.mk' | |
pull_request: | |
types: [opened] | |
workflow_dispatch: | |
workflow_call: | |
inputs: | |
is_called: | |
description: " is called by another actions" | |
default: false | |
type: boolean | |
jobs: | |
info: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "💬 github" | |
run: |+ | |
echo "Who launched: ${{ github.actor }}" | |
echo "On branch: ${{ github.ref_name }}" | |
echo "Commit sha: ${{ github.sha }}" | |
echo "Trigger event name ${{ github.event_name }}" | |
- name: "💬 Bin utils" | |
run: |+ | |
make --version && echo | |
ar --version && echo | |
gcc --verbose && echo | |
python3 --version | |
build: | |
strategy: | |
max-parallel: 5 | |
matrix: | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: ☁️ Retrieve repo | |
uses: actions/checkout@v3 | |
with: | |
repository: "Pixailz/ft_libft" | |
submodules: recursive | |
- name: ☁️ Update submodule | |
if: ${{ inputs.is_called }} | |
run: git submodule update --remote --recursive | |
- name: 🔧 Build up libft.a (${{ matrix.os }}) | |
run: |+ | |
DISABLE_HELPER=1 make fclean | |
DISABLE_HELPER=1 make | |
DISABLE_HELPER=1 make re | |
DISABLE_HELPER=1 make | |
- name: 🔧 Call helper | |
run: make helper | |
test: | |
strategy: | |
max-parallel: 5 | |
matrix: | |
test_src: [ | |
"ato.c", | |
"check/is_str.c", | |
"get_next_line.c", | |
"hton.c", | |
"int4.c", | |
"ipv4.c", | |
"isexec.c", | |
"ntop.c", | |
"parsing.c", | |
"print_nb_base.c", | |
"print.c", | |
"random.c", | |
"tmpfile.c", | |
] | |
runs-on: ubuntu-latest | |
steps: | |
- name: ☁️ Retrieve repo | |
uses: actions/checkout@v3 | |
with: | |
repository: "Pixailz/ft_libft" | |
submodules: recursive | |
- name: ☁️ Update submodule | |
if: ${{ inputs.is_called }} | |
run: git submodule update --remote --recursive | |
- name: 🔧 launch ${{ matrix.test_src }} | |
run: CI_TARGET=${{ matrix.test_src }} make ci-run | |
norminette: | |
runs-on: ubuntu-latest | |
steps: | |
- name: ☁️ Retrieve repo | |
uses: actions/checkout@v3 | |
with: | |
repository: "Pixailz/ft_libft" | |
submodules: recursive | |
- name: ☁️ Update submodule | |
if: ${{ inputs.is_called }} | |
run: git submodule update --remote --recursive | |
- name: ☁️ Setup python3 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
cache: 'pip' | |
- name: ☁️ Installing Norminette | |
run: pip install norminette | |
- name: 🔧 Run | |
run: python3 -m norminette ./src | |
do_release: | |
needs: [build, test, norminette] | |
if: ${{ ! inputs.is_called }} | |
uses: ./.github/workflows/CD.yml | |
secrets: inherit |