Skip to content

Commit f716685

Browse files
Merge pull request #4 from alexandreruban/configure-github-actions
Configure GitHub Actions
2 parents 6b6ab0f + 56ff1d9 commit f716685

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed

.github/FUNDING.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
github: [alexandreruban]

.github/workflows/tests.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
env:
17+
RAILS_ENV: test
18+
PGPASSWORD: postgres
19+
DATABASE_URL: postgresql://postgres:postgres@localhost:5432
20+
REDIS_URL: redis://localhost:6379/0
21+
22+
services:
23+
postgres:
24+
image: postgres
25+
env:
26+
POSTGRES_USER: postgres
27+
POSTGRES_PASSWORD: postgres
28+
POSTGRES_DB: postgres
29+
POSTGRES_HOST_AUTH_METHOD: trust
30+
options: >-
31+
--health-cmd pg_isready
32+
--health-interval 10s
33+
--health-timeout 5s
34+
--health-retries 5
35+
ports:
36+
- 5432:5432
37+
38+
redis:
39+
image: redis
40+
ports:
41+
- 6379:6379
42+
options: >-
43+
--health-cmd "redis-cli ping"
44+
--health-interval 10s
45+
--health-timeout 5s
46+
--health-retries 5
47+
48+
steps:
49+
- name: Checkout code
50+
uses: actions/checkout@v3
51+
52+
- name: Setup Ruby and install gems
53+
uses: ruby/setup-ruby@v1
54+
with:
55+
bundler-cache: true
56+
57+
- name: Setup test database
58+
run: bin/rails db:setup
59+
60+
- name: Run tests
61+
run: bin/rails test:all

Gemfile.lock

+3
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ GEM
127127
nio4r (2.5.9)
128128
nokogiri (1.14.3-arm64-darwin)
129129
racc (~> 1.4)
130+
nokogiri (1.14.3-x86_64-linux)
131+
racc (~> 1.4)
130132
pg (1.4.6)
131133
public_suffix (5.0.1)
132134
puma (5.6.5)
@@ -208,6 +210,7 @@ GEM
208210

209211
PLATFORMS
210212
arm64-darwin-21
213+
x86_64-linux
211214

212215
DEPENDENCIES
213216
bootsnap

0 commit comments

Comments
 (0)