name: Test and Release on: push: branches: - main jobs: test-2_5: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: 2.5 - name: Install dependencies run: bundle install - name: Run linter run: bundle exec rubocop - name: Run tests run: bundle exec rspec test-2_6: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: 2.6 - name: Install dependencies run: bundle install - name: Run linter run: bundle exec rubocop - name: Run tests run: bundle exec rspec test-2_7: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: 2.7 - name: Install dependencies run: bundle install - name: Run linter run: bundle exec rubocop - name: Run tests run: bundle exec rspec release: needs: [test-2_5, test-2_6, test-2_7] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: 2.7 - name: Install dependencies run: bundle install - name: Prepare credentials env: RUBYGEM_KEY: ${{ secrets.RUBYGEM_KEY }} run: "echo -e \"---\\r\\n:rubygems_api_key: $RUBYGEM_KEY\" > ~/.gem/credentials && chmod 0600 ~/.gem/credentials" - name: Setup username/email run: "git config --global user.email zaratan@hey.com && git config --global user.name \"Denis Pasin\"" - name: Publish run: rake release