Skip to content

Commit

Permalink
Tweak CI workflow to match Ruby on Rails template
Browse files Browse the repository at this point in the history
The only semantic change is switching the postgres image from
Debian-based to Alpine-based.

There are a couple of differences compared to the GitHub Actions Ruby
on Rails CI template:

 - The template only runs the job on push/pull-request for branch
   "master", but we run the job for all branches because we want to be
   able to push commits and have them tested without having to open a
   pull request.

 - The template runs on ubuntu-latest but we use ubuntu-20.04 because
   the build currently fails on ubuntu-latest.

 - The template doesn't have Docker health checks (for waiting until
   the services have started).

 - We have a "redis" service and a custom install script.

 - The template uses bin/rails etc., which we don't have yet.

 - The template has pretty step names, which we don't bother with.

 - The template's lint task uses bundler-audit, brakeman, and rubocop;
   we use standardrb.
  • Loading branch information
tom93 committed Jan 5, 2024
1 parent 65aef28 commit a25c637
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
name: Continuous Integration
on: [push, pull_request]
jobs:
build:
test:
runs-on: ubuntu-20.04
services:
postgres:
image: postgres:11
image: postgres:11-alpine
ports: ["5432:5432"]
env:
POSTGRES_DB: nztraintest
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports: ['5432:5432']
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis
ports: ['6379:6379']
ports: ["6379:6379"]
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
Expand Down

0 comments on commit a25c637

Please sign in to comment.