Skip to content

Commit

Permalink
WIP: github workflow to run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislo committed Aug 3, 2023
1 parent 8cf85f2 commit d8a9175
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI
on: [push]

jobs:
linters:
name: Linters
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Ruby and install gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Run linters
run: |
./bin/rubocop
tests:
name: Tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15-alpine
env:
POSTGRES_USER: myapp
POSTGRES_DB: myapp_test
POSTGRES_PASSWORD: password
ports: ["5432:5432"]
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Ruby and install gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Setup test database
env:
RAILS_ENV: test
PGHOST: localhost
PGUSER: myapp
run: |
bin/rails db:setup
- name: Run tests
run: ./bin/rake test:all
5 changes: 5 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ GEM
nio4r (2.5.9)
nokogiri (1.15.3-arm64-darwin)
racc (~> 1.4)
nokogiri (1.15.3-x86_64-linux)
racc (~> 1.4)
parallel (1.23.0)
parser (3.2.2.3)
ast (~> 2.4.1)
Expand Down Expand Up @@ -235,6 +237,8 @@ GEM
railties (>= 6.0.0)
tailwindcss-rails (2.0.30-arm64-darwin)
railties (>= 6.0.0)
tailwindcss-rails (2.0.30-x86_64-linux)
railties (>= 6.0.0)
thor (1.2.2)
timeout (0.4.0)
turbo-rails (1.4.0)
Expand All @@ -260,6 +264,7 @@ GEM

PLATFORMS
arm64-darwin-22
x86_64-linux

DEPENDENCIES
bootsnap
Expand Down

0 comments on commit d8a9175

Please sign in to comment.