docs(main) complete the readme with additionnal infos #3
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: 'Main workflow' | |
on: | |
push: {} | |
pull_request: | |
types: [review_requested] | |
env: | |
MIRROR_URL: 'git@github.com:EpitechPromo2027/B-CPE-200-REN-2-1-corewar-thibaut.hebert-henriette.git' | |
EXECUTABLES: 'asm/asm,corewar/corewar' | |
jobs: | |
check_coding_style: | |
runs-on: ubuntu-latest | |
container: 'ghcr.io/epitech/coding-style-checker:latest' | |
name: 'Check coding style' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 'Check coding style' | |
run: | | |
check.sh $(pwd) $(pwd) | |
if [ -s coding-style-reports.log ] | |
then | |
cat coding-style-reports.log | while read line; do | |
echo "::error file=$(echo "$line" | cut -d: -f1),"\ | |
"line=$(echo "$line" | cut -d: -f2),"\ | |
"title=$(echo "$line" | cut -d: -f3 | xargs)"\ | |
" coding style error::$(echo "$line" | cut -d: -f4)" | |
done | |
exit 1 | |
fi | |
check_program_compilation: | |
needs: check_coding_style | |
runs-on: ubuntu-latest | |
container: 'epitechcontent/epitest-docker:latest' | |
name: 'Check program compilation' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 'Check program compilation' | |
timeout-minutes: 2 | |
run: | | |
make | |
- name: 'Check clean rule' | |
run: | | |
make clean | |
- name: 'Check executables' | |
run: | | |
for executable in $(echo "$EXECUTABLES" | tr ',' ' ') | |
do | |
if [ ! -f "$executable" ] || [ ! -x "$executable" ] | |
then exit 1; fi | |
done | |
- name: 'Check fclean rule' | |
run: | | |
make fclean | |
for executable in $(echo "$EXECUTABLES" | tr ',' ' ') | |
do | |
if [ -f "$executable" ] | |
then exit 1; fi | |
done | |
run_tests: | |
needs: check_program_compilation | |
runs-on: ubuntu-latest | |
container: 'epitechcontent/epitest-docker:latest' | |
name: 'Run tests' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 'Run tests' | |
timeout-minutes: 2 | |
run: | | |
make tests_run | |
push_to_mirror: | |
needs: check_program_compilation | |
runs-on: ubuntu-latest | |
if: ${{ github.ref_name == 'main' }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: pixta-dev/repository-mirroring-action@v1 | |
with: | |
target_repo_url: | |
${{ env.MIRROR_URL }} | |
ssh_private_key: | |
${{ secrets.SSH_MIRROR_KEY }} |