test: stabilize completion registration check #50
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| lint: | |
| name: Lint (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install ShellCheck (Ubuntu) | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y shellcheck | |
| - name: Install zsh (Ubuntu) | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y zsh | |
| - name: Install ShellCheck (macOS) | |
| if: runner.os == 'macOS' | |
| run: brew install shellcheck | |
| - name: Run ShellCheck | |
| run: shellcheck install.sh uninstall.sh scripts/render-homebrew-formula.sh | |
| - name: Check zsh syntax | |
| run: zsh -n cwt.sh cwt.plugin.zsh completions/_cwt | |
| - name: Check Formula syntax | |
| run: ruby -c Formula/cwt.rb | |
| bats: | |
| name: BATS Tests (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install zsh (Ubuntu) | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y zsh | |
| - name: Install BATS (Ubuntu) | |
| if: runner.os == 'Linux' | |
| run: | | |
| git clone --depth 1 https://github.com/bats-core/bats-core.git /tmp/bats-core | |
| sudo /tmp/bats-core/install.sh /usr/local | |
| - name: Install BATS (macOS) | |
| if: runner.os == 'macOS' | |
| run: brew install bats-core | |
| - name: Run BATS tests | |
| run: bats tests/ |