forked from test-kitchen/test-kitchen
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (37 loc) · 890 Bytes
/
unit.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
---
name: unit_specs
"on":
pull_request:
push:
branches:
- main
concurrency:
group: unit-specs-${{ github.ref }}
cancel-in-progress: true
jobs:
unit:
name: Unit Test with Ruby
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ["3.1", "3.3"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check for Gemfile
id: check
run: |
if [ -f Gemfile ]; then
echo "gemfile=true" >> $GITHUB_OUTPUT
else
echo "gemfile=false" >> $GITHUB_OUTPUT
fi
- name: Setup Ruby
if: steps.check.outputs.gemfile == 'true'
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Rake Test
if: steps.check.outputs.gemfile == 'true'
run: bundle exec rake test