-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (33 loc) · 957 Bytes
/
ci.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
name: RSpec CI
on:
# allow running action manually
workflow_dispatch:
# trigger on push to master branch
pull_request:
branches:
- main
jobs:
CI:
runs-on: ubuntu-latest
permissions:
packages: read
steps:
- name: Create folders
run: |
mkdir -p /opt/workshops/
cd /opt/workshops
# Checkout the repository code
- name: Check out repository code
uses: actions/checkout@v4
- name: Start Docker containers
run: |
docker compose up --wait
- name: Create dev/test databases
run: |
docker exec $(docker ps --filter 'name=rails' -q) bash -lc "bundle exec rails db:create"
- name: Migrate dev/test databases
run: |
docker exec $(docker ps --filter 'name=rails' -q) bash -lc "bundle exec rails db:migrate"
- name: Run RSpec tests
run: |
docker exec $(docker ps --filter 'name=rails' -q) bash -lc "bundle exec rspec"