Skip to content

Fix rubocop offenses #276

Fix rubocop offenses

Fix rubocop offenses #276

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['2.7', '3.0', '3.1', '3.2', '3.3']
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Retrieve branch point
if: github.event_name == 'pull_request'
run: |
echo "::set-output name=KEY::$(diff -u <(git rev-list --first-parent origin/main) <(git rev-list --first-parent HEAD) | sed -ne 's/^ //p' | head -1)"
id: cache_keys
- name: Setup flutter state
id: flutter-state
uses: pat-s/always-upload-cache@v2.1.5
env:
cache-name: cache-flutter-state
with:
path: .flutter
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.ruby-version }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.ruby-version }}-${{ steps.cache_keys.outputs.KEY }}
- name: Lint
run: bundle exec rubocop
- name: Run tests (minitest+rspec)
env:
TESTOPTS: '-v'
RESET_STATE: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/main') }}
run: |
echo "Test options: $TESTOPTS"
echo "Reset flutter state: $RESET_STATE"
bundle exec rake test
- name: Run integration tests
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/main')
run: |
bundle exec rake integration
bundle exec rake integration
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/coverage.xml,./rspec_coverage/coverage.xml
- name: Upload flutter state
uses: actions/upload-artifact@v3
with:
name: flutter-state
path: ./.flutter
release:
needs: [test]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
bundler-cache: true
- name: Release gem
run: |
mkdir -p ~/.gem
echo ":github: \"${{ secrets.RUBYGEMS}}\"" > ~/.gem/credentials
chmod 0600 ~/.gem/credentials
bundle exec gem release -k github
- name: Generate release notes
run: |
bundle exec rake release_notes > release_notes.md
- name: Create GH Release
uses: ncipollo/release-action@v1
with:
bodyFile: release_notes.md
token: ${{ secrets.GITHUB_TOKEN }}