Add specs with spec/dummy app #421
Workflow file for this run
This file contains 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: 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 | |
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 }} | |
name: RSpec | |
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: 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 | |