Make conditional output based on the GIV_DEBUG flag #41
This file contains hidden or 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: Shell Compatibility & Bats CI | |
| on: | |
| push: | |
| branches: [main, dev/*] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| bats_tests: | |
| name: Run Bats tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| submodules: true | |
| - uses: bats-core/bats-action@3.0.1 | |
| - name: Run Bats | |
| shell: bash | |
| run: bats tests/*.bats | |
| shell_syntax_checks: | |
| name: Syntax & Cross-Shell Checks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Ensure dash is installed | |
| id: install-dash | |
| run: | | |
| if ! command -v dash >/dev/null; then | |
| sudo apt-get update | |
| sudo apt-get install -y dash | |
| fi | |
| - name: Located dash binary | |
| run: "echo \"DASH binary is at: $(which dash)\"" | |
| - name: Ensure zsh is installed | |
| id: install-zsh | |
| run: | | |
| if ! command -v zsh >/dev/null; then | |
| sudo apt-get update | |
| sudo apt-get install -y zsh | |
| fi | |
| - name: Located zsh binary | |
| run: "echo \"ZSH binary is at: $(which zsh)\"" | |
| - name: Ensure ash is installed | |
| id: install-ash | |
| run: | | |
| if ! command -v ash >/dev/null; then | |
| sudo apt-get update | |
| sudo apt-get install -y ash | |
| fi | |
| - name: Located ash binary | |
| run: "echo \"ASH binary is at: $(which ash)\"" | |
| - uses: actions/checkout@v3 | |
| - name: Syntax check in bash | |
| run: bash --posix -n ./src/giv.sh | |
| - name: Syntax check in sh | |
| run: sh -n ./src/giv.sh | |
| - name: Syntax check in dash | |
| run: dash -n ./src/giv.sh | |
| - name: Syntax check in zsh | |
| run: /usr/bin/zsh -n ./src/giv.sh | |
| - name: Syntax check in ash | |
| run: ash -n ./src/giv.sh | |
| - name: Install ShellCheck | |
| uses: ludeeus/action-shellcheck@master | |
| env: | |
| SHELLCHECK_OPTS: "--shell=sh --severity=warning" | |
| with: | |
| ignore_paths: tests build | |