-
Notifications
You must be signed in to change notification settings - Fork 4
46 lines (36 loc) · 1.15 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
name: ci
on:
workflow_dispatch:
pull_request:
jobs:
ci:
name: Build and run tests with containers
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v3
- name: Build Docker image
run: |
DOCKER_BUILDKIT=1 docker build -t gala_web .
- uses: docker/build-push-action@v5
with:
context: .
push: false
cache-from: type=gha,scope=${{ github.repository }}
cache-to: type=gha,mode=max,scope=${{ github.repository }}
tags: gala_web
- name: Docker Compose up
run: docker-compose up -d
- name: List running Docker containers
run: docker ps
- name: Run Tests
run: |
docker exec -e RAILS_ENV=test gala_web_1 bundle exec rails db:test:prepare
docker exec -e RAILS_ENV=test gala_web_1 bundle exec rspec --exclude-pattern="**/features/*_spec.rb"
- name: Docker Compose down
run: docker-compose down
- if: always()
uses: ouzi-dev/[email protected]
with:
name: Test
status: "${{ job.status }}"