Skip to content

Add specs with spec/dummy app #426

Add specs with spec/dummy app

Add specs with spec/dummy app #426

Workflow file for this run

name: RSpec
on:
push:
branches:
- main
pull_request:
jobs:
rspec-fast:
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
ruby:
- "2.7"
- "3.0"
runs-on: ${{ matrix.os }}
name: RSpec (Fast)
env:
RAILS_ENV: test
CPLN_TOKEN_CI: ${{ secrets.CPLN_TOKEN }}
CPLN_ORG_CI: ${{ secrets.CPLN_ORG }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Install dependencies
run: bundle install
- name: Install Control Plane tools
run: |
sudo npm install -g @controlplane/cli
cpln --version
- name: Setup Control Plane tools
run: |
cpln profile create default --token $CPLN_TOKEN_CI --org $CPLN_ORG_CI
cpln image docker-login
- name: Run fast tests
run: bundle exec rspec --format documentation
- name: Upload spec log
uses: actions/upload-artifact@master
if: always()
with:
name: spec-fast-${{ github.run_id }}-${{ matrix.os }}-${{ matrix.ruby }}.log
path: spec.log
- name: Upload coverage results
uses: actions/upload-artifact@master
if: always()
with:
name: coverage-report-fast-${{ github.run_id }}-${{ matrix.os }}-${{ matrix.ruby }}
path: coverage
rspec-slow:
strategy:
matrix:
os:
- ubuntu-latest
ruby:
- "3.0"
runs-on: ${{ matrix.os }}
needs: rspec-fast
name: RSpec (Slow)
env:
RAILS_ENV: test
CPLN_TOKEN_CI: ${{ secrets.CPLN_TOKEN }}
CPLN_ORG_CI: ${{ secrets.CPLN_ORG }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Install dependencies
run: bundle install
- name: Install Control Plane tools
run: |
sudo npm install -g @controlplane/cli
cpln --version
- name: Setup Control Plane tools
run: |
cpln profile create default --token $CPLN_TOKEN_CI --org $CPLN_ORG_CI
cpln image docker-login
- name: Run slow tests
run: CLEANUP=true bundle exec rspec --format documentation --tag slow
- name: Upload spec log
uses: actions/upload-artifact@master
if: always()
with:
name: spec-slow-${{ github.run_id }}-${{ matrix.os }}-${{ matrix.ruby }}.log
path: spec.log
- name: Upload coverage results
uses: actions/upload-artifact@master
if: always()
with:
name: coverage-report-slow-${{ github.run_id }}-${{ matrix.os }}-${{ matrix.ruby }}
path: coverage