Skip to content

Tom-Mendy verifying my code #85

Tom-Mendy verifying my code

Tom-Mendy verifying my code #85

Workflow file for this run

name: actions
run-name: ${{github.actor}} verifying my code
on:
push:
branches-ignore:
- " ga-ignore-"
pull_request:
branches-ignore:
- " ga-ignore-"
jobs:
check_program_compilation:
runs-on: ubuntu-latest
timeout-minutes: 2
# container: epitechcontent/epitest-docker:latest
steps:
- name: Checkout GH repository
uses: actions/checkout@master
with:
repository: ''
- name: Compile repository
run: make
- name: Clean repository
run: make clean
- name: Check file
run: |
for file in ${{ vars.EXECUTABLES }};do
if [ ! -x "$file" ]; then
echo"File $file does not exist or is not executable"
exit 1
fi
done
check_coding_style:
runs-on: ubuntu-latest
container: ghcr.io/epitech/coding-style-checker:latest
needs: check_program_compilation
steps:
- name: Checkout GH repository
uses: actions/checkout@master
with:
repository: ''
- name: Run coding-style
run: check.sh . /tmp
- name: Display banana report
run: cat /tmp/coding-style-reports.log
- name: Create annotation for coding-style errors
run: |
input=/tmp/coding-style-reports.log
while IFS= read -r -a line; do
fields=($(printf "%s" "$line"|cut -d':' --output-delimiter=' ' -f1-))
echo "::error title=${fields[2]} coding style error,file=${fields[0]},line=${fields[1]}::${fields[3]}"
done < $input
- name: Report banana result
run: |
NB_ERROR=$(cat /tmp/coding-style-reports.log | wc -l)
if [ $NB_ERROR -gt 0 ]; then
ERRORS=$(cat /tmp/coding-style-reports.log);
echo "Banana found $NB_ERROR error(s)"
echo "$ERRORS"
exit 1
fi
echo "Everything is good ! Keep on coding !"
exit 0
push_to_mirror:
runs-on: ubuntu-latest
needs: check_coding_style
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: pixta-dev/repository-mirroring-action@v1
with:
target_repo_url:
${{ vars.MIRROR_URL }}
ssh_private_key:
${{ secrets.GIT_SSH_PRIVATE_KEY }}