Skip to content

Commit f4751a3

Browse files
neko314gregmolnar
andcommitted
Port tests over to GitHub Actions
Co-authored-by: gregmolnar <[email protected]>
1 parent 2ec6c96 commit f4751a3

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

.github/workflows/main.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Main
2+
on: [push, pull_request]
3+
4+
jobs:
5+
base:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
ruby: ["3.0", 3.1]
11+
name: Running tests with Ruby ${{ matrix.ruby }}
12+
services:
13+
postgres:
14+
image: postgres:12
15+
env:
16+
POSTGRES_DB: triage_test
17+
POSTGRES_PASSWORD: password
18+
POSTGRES_USER: postgres
19+
ports: ["5432:5432"]
20+
env:
21+
BUNDLE_GEMFILE: Gemfile
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v2
26+
27+
- name: Setup Ruby
28+
uses: ruby/setup-ruby@v1
29+
with:
30+
ruby-version: ${{ matrix.ruby }}
31+
bundler-cache: true
32+
33+
- name: Setup database
34+
run: |
35+
cp config/database.ci.yml config/database.yml
36+
RAILS_ENV=test bundle exec rake db:create db:schema:load
37+
38+
- name: Run tests
39+
run: bin/rake test

config/database.ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
defaults: &defaults
2+
adapter: postgresql
3+
encoding: utf8
4+
pool: 5
5+
host: localhost
6+
password: password
7+
username: postgres
8+
9+
development:
10+
<<: *defaults
11+
database: triage_development
12+
13+
test:
14+
<<: *defaults
15+
database: triage_test

0 commit comments

Comments
 (0)