Skip to content

Merge pull request #50 from Savapitech/gui #83

Merge pull request #50 from Savapitech/gui

Merge pull request #50 from Savapitech/gui #83

Workflow file for this run

name: EpitechCI
on:
push:
branches: [ main, ai, gui, ia, Game, server ]
pull_request:
branches: [ main, ai, gui, ia, Game, server ]
workflow_dispatch:
env:
GH_PUB_KEY:
github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl
GH_BOT_ACC_EMAIL:
41898282+github-actions[bot]@users.noreply.github.com
GH_BOT_ACC_NAME:
github-actions[bot]
jobs:
check_the_repository_state:
runs-on: ubuntu-latest
steps:
- name: Get branch name
id: branch-names
uses: tj-actions/branch-names@v8
- uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ steps.branch-names.outputs.head_ref_branch }}
commit_lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Check commit messages follow Conventional Commits
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
range="origin/${{ github.event.pull_request.base.ref }}..${{ github.event.pull_request.head.sha }}"
else
range="${{ github.event.before }}..${{ github.event.after }}"
fi
status=0
while IFS= read -r subject; do
./.github/scripts/check-commit-msg.sh "$subject" || status=1
done < <(git log --format=%s "$range")
exit $status
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
name: ubuntu-x86_64
- os: ubuntu-24.04-arm
name: ubuntu-arm64
- os: macos-latest
name: macos-arm64
# - os: macos-13
# name: macos-x86_64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y ninja-build ccache libgl1-mesa-dev libx11-dev libglu1-mesa-dev libglew-dev
- name: Install system dependencies (macOS)
if: runner.os == 'macOS'
env:
HOMEBREW_NO_REQUIRE_TAP_TRUST: 1
run: |
for pkg in ninja ccache; do
brew list "$pkg" &>/dev/null || brew install "$pkg"
done
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2.23
with:
key: ${{ matrix.name }}-ccache
- name: Setup vcpkg (with GitHub Actions binary cache)
uses: lukka/run-vcpkg@v11
with:
vcpkgJsonGlob: 'gui/vcpkg.json'
- name: Build server
run: make zappy_server
- name: Build gui
run: make zappy_gui
sync_repository:
needs: [ check_the_repository_state, commit_lint, build ]
if: ${{ (!github.event.pull_request) && (github.ref_name == 'main') && (vars.GH_TARGET_REPO) }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.GH_SSH_PRIVATE_KEY }}
known_hosts: $GH_PUB_KEY
- name: Setup git
run: |
git config --global user.email "savinien.petitjean@epitech.eu"
git config --global user.name "savalet"
git remote add target "${{ vars.GH_TARGET_REPO }}"
- name: Create the verbatim branch
run: |
git checkout -b main || git checkout main
git push --set-upstream target main --force