From fb4e1eac38839edc4b2ac19442b2ff8d6dc97ab6 Mon Sep 17 00:00:00 2001 From: Periicles Date: Sun, 14 Jun 2026 15:41:47 +0200 Subject: [PATCH 1/4] ci: build the project and run the test suite in CI The workflow only checked repository size and coding style; it never built the code or ran the tests, and it predates the CSFML 3 migration. Add a build_and_test job that installs the SFML 3 / CSFML 3 toolchain (built from source and cached, since the Ubuntu packages are still CSFML 2), compiles the project with `make`, and runs the criterion suite with `make tests_run`. The mirror step now waits on both the coding-style and build/test jobs so a broken build is never mirrored. The existing size and coding-style jobs are unchanged. --- .github/workflows/rpg.yml | 51 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpg.yml b/.github/workflows/rpg.yml index f5bda82..d017040 100644 --- a/.github/workflows/rpg.yml +++ b/.github/workflows/rpg.yml @@ -52,9 +52,56 @@ jobs: exit 1 fi + build_and_test: + runs-on: ubuntu-latest + steps: + + - name: Checkout GH repository + uses: actions/checkout@v4 + + - name: Install build dependencies + run: | + sudo apt-get update + sudo apt-get install -y cmake g++ pkg-config libcriterion-dev \ + libxrandr-dev libxcursor-dev libxi-dev libudev-dev \ + libgl1-mesa-dev libfreetype-dev libflac-dev libvorbis-dev \ + libogg-dev libopenal-dev libx11-dev + + - name: Cache SFML/CSFML 3 install + id: cache-csfml + uses: actions/cache@v4 + with: + path: ~/csfml-prefix + key: csfml-3.0.0-${{ runner.os }} + + - name: Build SFML 3 + CSFML 3 from source + if: steps.cache-csfml.outputs.cache-hit != 'true' + run: | + git clone --depth 1 --branch 3.0.0 https://github.com/SFML/SFML.git + cmake -S SFML -B sfml-build -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=$HOME/csfml-prefix + cmake --build sfml-build --target install -j $(nproc) + git clone --depth 1 --branch 3.0.0 https://github.com/SFML/CSFML.git + cmake -S CSFML -B csfml-build -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=$HOME/csfml-prefix \ + -DCMAKE_PREFIX_PATH=$HOME/csfml-prefix + cmake --build csfml-build --target install -j $(nproc) + + - name: Install SFML/CSFML 3 into system prefix + run: | + sudo cp -a $HOME/csfml-prefix/include/. /usr/local/include/ + sudo cp -a $HOME/csfml-prefix/lib/. /usr/local/lib/ + sudo ldconfig + + - name: Build + run: make + + - name: Run unit tests + run: make tests_run + push_to_mirror: runs-on: ubuntu-latest - needs: check_coding_style + needs: [check_coding_style, build_and_test] if: github.event_name == 'push' steps: - uses: actions/checkout@v3 @@ -65,4 +112,4 @@ jobs: target_repo_url: ${{ vars.MIRROR_URL }} ssh_private_key: - ${{ secrets.GIT_SSH_PRIVATE_KEY }} \ No newline at end of file + ${{ secrets.GIT_SSH_PRIVATE_KEY }} From 111266d8b8932507eb2483bea845a36dd449cc71 Mon Sep 17 00:00:00 2001 From: Periicles Date: Sun, 14 Jun 2026 15:46:30 +0200 Subject: [PATCH 2/4] ci: replace removed coding-style image with Banana MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The check_coding_style job pulled ghcr.io/epitech/coding-style-checker, which no longer exists (manifest unknown) — the job had been failing on infrastructure, not on the code. Epitech replaced that tool with Banana. Add a coding_style job that installs Banana from the epitech PPA, runs the epiclang plug-in over the sources (filtered to project files; CSFML 3 headers are fetched so the includes resolve) and runs banana-check-repo for the repository rules. The mirror now waits on this job and on build_and_test. --- .github/workflows/rpg.yml | 57 +++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/.github/workflows/rpg.yml b/.github/workflows/rpg.yml index d017040..889b3ec 100644 --- a/.github/workflows/rpg.yml +++ b/.github/workflows/rpg.yml @@ -24,34 +24,6 @@ jobs: fi du -skh --exclude=.git - check_coding_style: - runs-on: ubuntu-latest - container: ghcr.io/epitech/coding-style-checker:latest - steps: - - - name: Checkout GH repository - uses: actions/checkout@v3 - with: - repository: '' - - - name: Run coding-style - run: check.sh . /tmp - - - name: Create annotation for coding-style errors - run: | - input=/tmp/coding-style-reports.log - while IFS= read -r -a line; do - fields=($(printf "%s" "$line"|cut -d':' --output-delimiter=' ' -f1-)) - echo "::error title=${fields[2]} coding style error,file=${fields[0]},line=${fields[1]}::${fields[3]}" - done < $input - - - name: Report banana result - run: | - NB_ERROR=$(cat /tmp/coding-style-reports.log | wc -l) - if [ $NB_ERROR -gt 0 ]; then - exit 1 - fi - build_and_test: runs-on: ubuntu-latest steps: @@ -99,9 +71,36 @@ jobs: - name: Run unit tests run: make tests_run + coding_style: + runs-on: ubuntu-latest + steps: + + - name: Checkout GH repository + uses: actions/checkout@v4 + + - name: Install Banana and a CSFML 3 header tree + run: | + sudo add-apt-repository -y ppa:epitech/ppa + sudo apt-get update + sudo apt-get install -y banana-coding-style-checker cmake g++ + git clone --depth 1 --branch 3.0.0 https://github.com/SFML/CSFML.git + sudo mkdir -p /usr/local/include + sudo cp -a CSFML/include/. /usr/local/include/ + + - name: Code rules (epiclang) + run: | + for f in $(find src -name '*.c'); do \ + epiclang -fsyntax-only -I include -I /usr/local/include "$f" 2>&1; \ + done | grep '\[Banana\]' | grep -E '^(src|include)/' > banana.log \ + || true + if [ -s banana.log ]; then cat banana.log; exit 1; fi + + - name: Repository rules (banana-check-repo) + run: banana-check-repo . + push_to_mirror: runs-on: ubuntu-latest - needs: [check_coding_style, build_and_test] + needs: [coding_style, build_and_test] if: github.event_name == 'push' steps: - uses: actions/checkout@v3 From a6bcc828862b1baf38f1f0feeb0d17f6eb388da0 Mon Sep 17 00:00:00 2001 From: Periicles Date: Sun, 14 Jun 2026 15:51:04 +0200 Subject: [PATCH 3/4] ci: clone CSFML headers outside the repo for the style check banana-check-repo scans the working directory, so cloning CSFML into the checkout made it flag every CSFML header as an invalid file name (C-O4). Clone the header tree into $HOME instead, leaving the repository tree clean for the repository-rule check. --- .github/workflows/rpg.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpg.yml b/.github/workflows/rpg.yml index 889b3ec..d7ab324 100644 --- a/.github/workflows/rpg.yml +++ b/.github/workflows/rpg.yml @@ -83,9 +83,10 @@ jobs: sudo add-apt-repository -y ppa:epitech/ppa sudo apt-get update sudo apt-get install -y banana-coding-style-checker cmake g++ - git clone --depth 1 --branch 3.0.0 https://github.com/SFML/CSFML.git + git clone --depth 1 --branch 3.0.0 \ + https://github.com/SFML/CSFML.git "$HOME/csfml-src" sudo mkdir -p /usr/local/include - sudo cp -a CSFML/include/. /usr/local/include/ + sudo cp -a "$HOME/csfml-src/include/." /usr/local/include/ - name: Code rules (epiclang) run: | From 84f619870cb70ebca31d44310fd91dd140da5f42 Mon Sep 17 00:00:00 2001 From: Periicles Date: Tue, 16 Jun 2026 17:55:56 +0200 Subject: [PATCH 4/4] ci: only mirror when a target repository is configured The push_to_mirror job ran on every push and failed with "no path specified" whenever vars.MIRROR_URL is unset (any fork without the Epitech mirror configured). Guard it on a non-empty MIRROR_URL so it is skipped instead of failing; it still runs once the mirror variable and SSH key are set. --- .github/workflows/rpg.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpg.yml b/.github/workflows/rpg.yml index d7ab324..02fc6d5 100644 --- a/.github/workflows/rpg.yml +++ b/.github/workflows/rpg.yml @@ -102,7 +102,7 @@ jobs: push_to_mirror: runs-on: ubuntu-latest needs: [coding_style, build_and_test] - if: github.event_name == 'push' + if: github.event_name == 'push' && vars.MIRROR_URL != '' steps: - uses: actions/checkout@v3 with: