diff --git a/.github/workflows/gen_clib_pro_docker_checker.yml b/.github/workflows/gen_clib_pro_docker_checker.yml deleted file mode 100644 index 0040cf2..0000000 --- a/.github/workflows/gen_clib_pro_docker_checker.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: gen_clib_pro docker checker -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Build Docker image - id: docker_checker - run: | - echo Building Docker image - build_transcript=$(docker build . --file Dockerfile --tag gen_clib_pro:latest) - [[ "$build_transcript" == *"Successfully"* ]] && echo ::set-output name=status::success || echo ::set-output name=status::failure - - name: Check on failures - if: steps.docker_checker.outputs.status == 'failure' - run: exit 1 diff --git a/.github/workflows/gen_clib_pro_shell_checker.yml b/.github/workflows/gen_clib_pro_shell_checker.yml index d4fba80..60b3d6a 100644 --- a/.github/workflows/gen_clib_pro_shell_checker.yml +++ b/.github/workflows/gen_clib_pro_shell_checker.yml @@ -1,24 +1,22 @@ -name: gen_clib_pro shell checker +name: gen_clib_pro_shell_checker on: push: branches: [ master ] + paths: + - 'sh_tool/**' pull_request: branches: [ master ] + paths: + - 'sh_tool/**' jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Check syntax script - id: syntax_checker - run: | - bash -n sh_tool/bin/gen_clib_pro.sh && echo ::set-output name=status::success || echo ::set-output name=status::failure + - uses: actions/checkout@v4 - name: Check size script id: size_checker run: | - echo Checking size - code_line_number=$(wc -l < sh_tool/bin/gen_clib_pro.sh) - [[ $code_line_number -gt 300 ]] && echo ::set-output name=status::failure || echo ::set-output name=status::success - - name: Check on failures - if: steps.syntax_checker.outputs.status == 'failure' || steps.size_checker.outputs.status == 'failure' - run: exit 1 + modules_ok=0 + modules=($(find sh_tool/ -type f -name '*.sh' -exec echo '{}' \;)) + for mod in "${modules[@]}"; do line_numbers=$(wc -l < "${mod}"); [[ $line_numbers -gt 300 ]] && modules_ok=1; done + [[ $modules_ok -eq 0 ]] && echo ok || exit 1 \ No newline at end of file diff --git a/.github/workflows/gen_clib_pro_toc.yml b/.github/workflows/gen_clib_pro_toc.yml index 8b4178f..11d107a 100644 --- a/.github/workflows/gen_clib_pro_toc.yml +++ b/.github/workflows/gen_clib_pro_toc.yml @@ -1,8 +1,8 @@ -name: gen_clib_pro toc +name: gen_clib_pro_toc on: push jobs: generateTOC: name: TOC Generator runs-on: ubuntu-latest steps: - - uses: technote-space/toc-generator@v2 + - uses: technote-space/toc-generator@v4 \ No newline at end of file