Skip to content

Commit 71dde30

Browse files
committed
Setup GitHub Actions
1 parent 4c17728 commit 71dde30

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

.github/workflows/ci.yml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
name: CI
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
tests:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
ruby:
14+
- "3.0"
15+
- "3.1"
16+
- "3.2"
17+
- "3.3"
18+
rails:
19+
- "6-1"
20+
- "7-0"
21+
- "7-1"
22+
23+
services:
24+
mysql:
25+
image: "mysql:8.0"
26+
env:
27+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
28+
ports:
29+
- 3306:3306
30+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
31+
32+
postgres:
33+
image: "postgres:14.11"
34+
env:
35+
POSTGRES_HOST_AUTH_METHOD: trust
36+
options: >-
37+
--health-cmd pg_isready
38+
--health-interval 10s
39+
--health-timeout 5s
40+
--health-retries 5
41+
ports:
42+
- 5432:5432
43+
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- name: Set up Ruby
48+
uses: ruby/setup-ruby@v1
49+
with:
50+
ruby-version: ${{ matrix.ruby }}
51+
bundler-cache: false
52+
53+
- name: Bundle for Appraisal
54+
run: bundle
55+
56+
- name: Install Appraisal dependencies
57+
run: bundle exec appraisal rails-${{ matrix.rails }} bundle
58+
59+
- name: Configure config database.yml
60+
run: bundle exec appraisal rails-${{ matrix.rails }} bundle exec rake db:copy_credentials
61+
62+
- name: Setup database
63+
run: bundle exec appraisal rails-${{ matrix.rails }} bundle exec rake db:test:prepare
64+
65+
- name: Run tests
66+
run: bundle exec appraisal rails-${{ matrix.rails }} bundle exec rspec --format documentation --format RspecJunitFormatter --out rspec.xml
67+
68+
- name: Test Summary
69+
uses: test-summary/action@v2
70+
with:
71+
paths: "rspec.xml"
72+
if: always()

0 commit comments

Comments
 (0)