-
Notifications
You must be signed in to change notification settings - Fork 4
46 lines (44 loc) · 1.48 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: 'Continuous Integration'
on:
push:
branches: ['main']
pull_request:
branches: ['main']
workflow_call:
jobs:
push:
name: 'Run tests'
runs-on: 'ubuntu-latest'
permissions:
contents: 'read'
steps:
- name: 'Checkout code'
uses: 'actions/checkout@v4'
- name: 'Log in to the Container registry'
uses: 'docker/login-action@v3'
with:
username: '${{ secrets.REGISTRY_USERNAME }}'
password: '${{ secrets.REGISTRY_PASSWORD }}'
- name: 'Set up Docker Buildx'
uses: 'docker/setup-buildx-action@v3'
- name: 'Build'
uses: 'docker/build-push-action@v5'
with:
tags: 'jeanberu/mailcatcher:latest'
platforms: 'linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8'
cache-from: 'type=gha'
cache-to: 'type=gha,mode=max'
- name: 'Start mailcatcher'
run: 'docker run --detach --publish 1025:1025 --publish 1080:1080 jeanberu/mailcatcher:latest'
- name: 'Install Ruby dependencies'
uses: 'ruby/setup-ruby@v1'
with:
ruby-version: '3.3'
bundler-cache: true
- name: 'Wait for mailcatcher'
run: |
while ! nc -z 0.0.0.0 1025 </dev/null; do echo Waiting for SMTP to start...; sleep 1; done
while ! nc -z 0.0.0.0 1080 </dev/null; do echo Waiting for API to start...; sleep 1; done
timeout-minutes: 1
- name: 'Run tests'
run: 'bundle exec rspec spec/*'