-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
62 lines (61 loc) · 1.79 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: 'RSpec action'
description: 'Run RSpec tests'
inputs:
ruby_version:
description: 'Ruby Version'
required: false
node_version:
description: 'Node Version'
required: false
command:
description: 'Command to run'
required: true
default: 'bundle exec rspec'
prepare_command:
description: 'Command to run before rspec'
required: true
default: 'bundle exec rake test_app'
runs:
using: "composite"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ${{ inputs.ruby_version || env.RUBY_VERSION }}
- uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node_version || env.NODE_VERSION }}
- name: Get Yarn cache directory
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
shell: bash
- name: Use Yarn cache
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn install --prefer-offline --frozen-lockfile
shell: bash
- run: ${{ inputs.prepare_command }}
name: Create test app
shell: bash
- run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots
name: Create the screenshots folder
shell: bash
- uses: nanasess/setup-chromedriver@v2
- uses: OpenSourcePolitics/cache-precompile-action@master
- run: ${{ inputs.command }}
name: RSpec
shell: bash
- uses: codecov/codecov-action@v1
- uses: actions/upload-artifact@v3
if: always()
with:
name: screenshots
path: ./spec/decidim_dummy_app/tmp/screenshots
if-no-files-found: ignore