From a25c63739777cc51e9a4edbb72e2d7192a3ad7d6 Mon Sep 17 00:00:00 2001 From: Tom Levy Date: Fri, 5 Jan 2024 21:03:01 +1300 Subject: [PATCH] Tweak CI workflow to match Ruby on Rails template 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. --- .github/workflows/ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 64aacc93..c2b1035a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,15 +1,16 @@ 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 @@ -17,7 +18,7 @@ jobs: --health-retries 5 redis: image: redis - ports: ['6379:6379'] + ports: ["6379:6379"] options: >- --health-cmd "redis-cli ping" --health-interval 10s