Enforcing shell script tests #284
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: Enforcing shell script tests | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
pull_request: | |
branches: | |
- main | |
- develop | |
tags: | |
- v* | |
schedule: | |
# Every 01:00 Sunday re-run the test on the main branch | |
- cron: '0 1 * * 0' | |
workflow_dispatch: | |
jobs: | |
testing: | |
runs-on: ubuntu-latest | |
name: Running testing | |
strategy: | |
matrix: | |
app: [shellcheck, shfmt] | |
include: | |
- app: shellcheck | |
shellcheck_opts: | |
shellcheck_disable: false | |
shfmt_disable: true | |
- app: shfmt | |
shfmt_opts: -i 2 -ci -w | |
shellcheck_disable: true | |
shfmt_disable: false | |
steps: | |
- name: Fetch source code | |
uses: actions/checkout@v2 | |
- name: shell check | |
uses: luizm/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SHELLCHECK_OPTS: ${{ matrix.shellcheck_opts }} | |
SHFMT_OPTS: ${{ matrix.shfmt_opts }} | |
with: | |
sh_checker_shellcheck_disable: ${{ matrix.shellcheck_disable }} | |
sh_checker_shfmt_disable: ${{ matrix.shfmt_disable }} |