-
Notifications
You must be signed in to change notification settings - Fork 22
47 lines (40 loc) · 1.27 KB
/
run-test.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
name: Run Test
on:
pull_request:
push:
branches:
- develop
- main
jobs:
run-test:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore Cache
uses: actions/cache@v4
id: bundle_cache_id
env:
cache-name: cache-bundle
with:
path: ./vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gem-${{ env.cache-name }}-
${{ runner.os }}-gem-
${{ runner.os }}-
- name: Up Docker Container
run: docker compose -f docker-compose.ci.yml up -d
- name: Install Packages
shell: bash
run: |
docker compose -f docker-compose.ci.yml exec app bundle install --jobs=16
docker compose -f docker-compose.ci.yml exec app bundle clean --force
- name: Setup DB
run: |
docker compose -f docker-compose.ci.yml exec app sh -c "cd ./spec/dummy && bundle exec rails db:setup"
- name: Run Test
run: docker compose -f docker-compose.ci.yml exec app bundle exec rspec
- name: Down Docker Container
run: docker compose -f docker-compose.ci.yml down