-
Notifications
You must be signed in to change notification settings - Fork 22
47 lines (37 loc) · 1.12 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: test
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Start containers
run: docker compose -f compose.ci.yml up -d
- name: Install dependencies
run: |
docker compose -f compose.ci.yml exec app bundle install --jobs=16
docker compose -f compose.ci.yml exec app bundle clean --force
- name: Setup database
run: |
docker compose -f compose.ci.yml exec app sh -c "cd ./spec/dummy && bundle exec rails db:setup"
- name: Run tests
run: docker compose -f compose.ci.yml exec app bundle exec rspec
- name: Stop containers
run: docker compose -f compose.ci.yml down