.github/workflows/rspec-shared.yml in cpflow-3.0.1 vs .github/workflows/rspec-shared.yml in cpflow-4.0.0
- old
+ new
@@ -1,23 +1,26 @@
name: RSpec Shared
on:
workflow_call:
inputs:
- os-version:
+ os_version:
required: true
type: string
- ruby-version:
+ ruby_version:
required: true
type: string
- test-tag:
- required: true
+ test_tag:
+ required: false
type: string
+ spec_paths:
+ required: false
+ type: string
jobs:
rspec:
- runs-on: ${{ inputs.os-version }}
+ runs-on: ${{ inputs.os_version }}
env:
RAILS_ENV: test
# We have to add "_CI" to the end, otherwise it messes with tests where we switch profiles,
# as Control Plane will try to use this token's profile instead.
CPLN_TOKEN_CI: ${{ secrets.CPLN_TOKEN }}
@@ -26,11 +29,11 @@
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
- ruby-version: ${{ inputs.ruby-version }}
+ ruby-version: ${{ inputs.ruby_version }}
bundler-cache: true
- name: Install dependencies
run: bundle install
- name: Install Control Plane tools
run: |
@@ -39,18 +42,18 @@
- name: Setup Control Plane tools
run: |
cpln profile create default --token $CPLN_TOKEN_CI --org $CPLN_ORG
cpln image docker-login
- name: Run tests
- run: bundle exec rspec --format documentation --tag ${{ inputs.test-tag }}
+ run: bundle exec rspec --format documentation ${{ inputs.test_tag && format('--tag {0}', inputs.test_tag) }} ${{ inputs.spec_paths }}
- name: Upload spec log
uses: actions/upload-artifact@master
if: always()
with:
- name: spec-${{ inputs.test-tag }}-${{ github.run_id }}-${{ inputs.os-version }}-${{ inputs.ruby-version }}.log
+ name: spec-${{ inputs.test_tag }}-${{ github.run_id }}-${{ inputs.os_version }}-${{ inputs.ruby_version }}.log
path: spec.log
- name: Upload coverage results
uses: actions/upload-artifact@master
if: always()
with:
- name: coverage-report-${{ inputs.test-tag }}-${{ github.run_id }}-${{ inputs.os-version }}-${{ inputs.ruby-version }}
+ name: coverage-report-${{ inputs.test_tag }}-${{ github.run_id }}-${{ inputs.os_version }}-${{ inputs.ruby_version }}
path: coverage