Skip to content

๐Ÿ‘ถ Basic logic components #16

๐Ÿ‘ถ Basic logic components

๐Ÿ‘ถ Basic logic components #16

Workflow file for this run

name: ๐Ÿฉบ Checks
on:
pull_request:
branches:
- master
- main
jobs:
lint:
name: ๐Ÿ•ต๏ธ Lint
runs-on: ubuntu-latest
container:
image: ghcr.io/epitech/coding-style-checker:latest
steps:
- name: ๐Ÿ›ฌ Clone original repository
uses: actions/checkout@v3
- name: ๐Ÿƒโ€ Run checker
run: check.sh $(pwd) $(pwd)
- name: ๐Ÿšจ Report errors and warnings
shell: bash
run: |
ERROR_COUNT=$(wc -l coding-style-reports.log | cut -d' ' -f1)
while read line
do
FILE=$(echo ${line} | cut -d':' -f 1)
LINE=$(echo ${line} | cut -d':' -f 2)
TYPE=$(echo ${line} | cut -d':' -f 3)
CODE=$(echo ${line} | cut -d':' -f 4)
echo "::error file=${FILE},line=${LINE},title=${TYPE} coding style error::${CODE}"
done < coding-style-reports.log
if [ $ERROR_COUNT -gt 0 ]; then
exit 1
fi
- name: ๐Ÿงน Clean up
run: rm coding-style-reports.log
build:
name: ๐Ÿ—๏ธ Build
runs-on: ubuntu-latest
needs: lint
steps:
- name: ๐Ÿ›ฌ Clone original repository
uses: actions/checkout@v3
- name: ๐Ÿ—๏ธ Build program
run: make
- name: ๐Ÿ”๏ธ Check binary
run: |
if [ -x "nanotekspice" ]; then
printf "### :hammer: Build\n\n:heavy_check_mark: Program built successfully." >> $GITHUB_STEP_SUMMARY
else
printf "### :hammer: Build\n\n:x: Program failed to build." >> $GITHUB_STEP_SUMMARY
exit 1
fi