Skip to content

DoctorPok42 rpg checks #256

DoctorPok42 rpg checks

DoctorPok42 rpg checks #256

Workflow file for this run

name: rpg
run-name: ${{github.actor}} rpg checks
on:
push:
branches-ignore:
- " ga-ignore-"
pull_request:
branches-ignore:
- " ga-ignore-"
jobs:
size:
runs-on: ubuntu-latest
steps:
- name: Checkout GH repository
uses: actions/checkout@v3
- name: Check size
run: |
SIZE=$(du -skh --exclude=.git | cut -f1)
if [ $SIZE -gt 30000 ]; then
echo "Size of the repository is too big"
exit 1
fi
du -skh --exclude=.git
check_coding_style:
runs-on: ubuntu-latest
container: ghcr.io/epitech/coding-style-checker:latest
steps:
- name: Checkout GH repository
uses: actions/checkout@v3
with:
repository: ''
- name: Run coding-style
run: check.sh . /tmp
- 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
exit 1
fi
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 }}