๐ถ Basic logic components #16
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |