From c9f27df7b4abb3c331479c72dcd2116e0ecc4b57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Le=20Bihan?= Date: Sun, 23 May 2021 18:54:03 +0200 Subject: [PATCH] adding our own github action for coding style --- .github/workflows/codingstyle.yml | 33 +++++++++++++++++++++++++++++++ .github/workflows/doc.yml | 28 +++++--------------------- 2 files changed, 38 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/codingstyle.yml diff --git a/.github/workflows/codingstyle.yml b/.github/workflows/codingstyle.yml new file mode 100644 index 00000000..72838f50 --- /dev/null +++ b/.github/workflows/codingstyle.yml @@ -0,0 +1,33 @@ +name: Build +on: [push, pull_request] + +jobs: + Build: + name: "Build on ${{ matrix.name }}" + runs-on: ${{ matrix.os }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository + strategy: + matrix: + include: + - os: ubuntu-latest + name: Linux + steps: + - uses: actions/checkout@v1 + with: + submodules: true + - name: Install Xorg lib + if: matrix.name == 'Linux' + run: | + sudo apt install -y libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev + - name: Update G++ + if: matrix.name == 'Linux' + run: sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100 + - name: Build + run: | + mkdir build && cd build + cmake .. + cmake --build . + - name: CheckBinaryName + shell: bash + if: matrix.name == 'Linux' + run: test -f build/bomberman diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index de0e84de..fbaa0e2b 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -1,31 +1,13 @@ name: Update the documentation - -on: - push: - branches: - - master - - workflow +on: [push] jobs: Building: runs-on: [ubuntu-latest] steps: - uses: actions/checkout@v1 - - name: Install Doxygen - run: sudo apt-get install -y doxygen graphviz - - name: Update the docs + - name: Install cpplint + run: pip install cpplint + - name: Check coding style run: | - rm -rf docs/* - doxygen Doxyfile - cd docs - git config --global user.email "${GITHUB_ACTOR}@github.com"; - git config --global user.name "${GITHUB_ACTOR}"; - git init - git add -A; - git commit -m "Deploying the documentation"; - git remote add origin https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@${GITHUB_REPO}; - git checkout -b Documentation - git push --force origin Documentation; - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_REPO: "github.com/AnonymusRaccoon/Bomberman" \ No newline at end of file + cpplint --recursive --quiet --verbose=3 \ No newline at end of file