Fix for Home Assistant MQTT Issue #9
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: | |
| jobs: | |
| ruby: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| ruby-version: ["3.2", "3.3"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Normalize line endings | |
| run: find . -name '*.rb' -not -path './vendor/*' -exec sed -i 's/\r$//' {} + | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby-version }} | |
| bundler-cache: false | |
| - name: Bundle install | |
| run: | | |
| bundle config set frozen false | |
| bundle install --full-index --jobs 4 --retry 3 | |
| - name: Lint | |
| run: bundle exec rubocop | |
| - name: Test (if present) | |
| shell: bash | |
| run: | | |
| if [ -d spec ]; then | |
| bundle exec rspec | |
| elif [ -d test ]; then | |
| if bundle exec rake -T | grep -q "\btest\b"; then | |
| bundle exec rake test | |
| else | |
| echo "No explicit test task found; skipping tests" | |
| fi | |
| else | |
| echo "No spec/ or test/ directory found; skipping tests" | |
| fi |