Update CI with clang-format condition (#11)

* Update CI with clang-format condition

* Only run CI on either push to master or pull to master, not both
This commit is contained in:
Salanto 2022-04-27 14:34:38 +02:00 committed by Rosemary Witchaven
parent e01f0e1c57
commit ec44039816

View File

@ -4,11 +4,29 @@ name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on: [push, pull_request]
on:
push:
branches:
- master
pull_request:
branches:
- master
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
formatting-check:
name: check-clang-format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run clang-format style check.
uses: jidicula/clang-format-action@v4.5.0
with:
clang-format-version: '14'
check-path: '.'
build-linux:
needs: formatting-check
# The type of runner that the job will run on
runs-on: ubuntu-latest
@ -22,7 +40,6 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install qt5-default libqt5websockets5-dev g++ make
# Runs a set of commands using the runners shell
- name: qmake and build
run: |
@ -30,7 +47,6 @@ jobs:
qmake
make
mv bin/config_sample bin/config
- name: Run tests
run: |
for test in bin_tests/*; do
@ -44,6 +60,7 @@ jobs:
path: bin/
build-windows:
needs: formatting-check
runs-on: windows-latest
steps:
@ -60,7 +77,6 @@ jobs:
nmake
windeployqt bin\akashi.exe --release --no-opengl-sw
mv bin\config_sample bin\config
- name: Run tests
run: |
for test in bin_tests/*; do
@ -79,4 +95,4 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: akashi-windows
path: bin\
path: bin\