ci: align triggers + route dependabot through develop #4
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 | |
| # Runs on GitHub Actions. | |
| on: | |
| push: | |
| pull_request: | |
| # Least privilege: this workflow only reads the repo to lint and test it. | |
| permissions: | |
| contents: read | |
| jobs: | |
| shellcheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Ensure shellcheck is available | |
| run: command -v shellcheck >/dev/null 2>&1 || { sudo apt-get update && sudo apt-get install -y shellcheck; } | |
| - name: Lint | |
| run: | | |
| bash -n ssh-deploy | |
| shellcheck ssh-deploy | |
| test: | |
| # Run on Linux (GNU userland) and macOS (BSD userland + bash 3.2) to back up | |
| # the portability claims. shellcheck above is OS-independent, so it stays Linux-only. | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Install bats (Linux) | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y bats | |
| - name: Install bats (macOS) | |
| if: runner.os == 'macOS' | |
| run: brew install bats-core | |
| - name: Run tests | |
| run: bats test |