Skip to content

Merge pull request #1083 from alphagov/dependabot/bundler/selenium-we… #756

Merge pull request #1083 from alphagov/dependabot/bundler/selenium-we…

Merge pull request #1083 from alphagov/dependabot/bundler/selenium-we… #756

Workflow file for this run

name: Build
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
bundle-audit:
runs-on: ubuntu-24.04
services:
postgres:
image: postgres:16
ports: ["5432:5432"]
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
memcached:
image: memcached:1.5
ports: ["11211:11211"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-24.04-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-24.04-gems-
- name: Setup
uses: ./.github/actions/setup
- name: Check bundle for known CVEs
run: |
bundle exec rake bundle:audit
brakeman:
runs-on: ubuntu-24.04
services:
postgres:
image: postgres:16
ports: ["5432:5432"]
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
memcached:
image: memcached:1.5
ports: ["11211:11211"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-24.04-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-24.04-gems-
- name: Setup
uses: ./.github/actions/setup
- name: Analyse code for vulnerabilities
run: |
bundle exec rake brakeman:check
spec-admin-controllers:
runs-on: ubuntu-24.04
services:
postgres:
image: postgres:16
ports: ["5432:5432"]
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
memcached:
image: memcached:1.5
ports: ["11211:11211"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-24.04-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-24.04-gems-
- name: Setup
uses: ./.github/actions/setup
- name: Run specs
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/epets_test
RAILS_ENV: test
SPEC_OPTS: "-f doc --force-color -P spec/controllers/admin/*_spec.rb"
run: |
bundle exec rake spec:controllers
spec-public-controllers:
runs-on: ubuntu-24.04
services:
postgres:
image: postgres:16
ports: ["5432:5432"]
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
memcached:
image: memcached:1.5
ports: ["11211:11211"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-24.04-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-24.04-gems-
- name: Setup
uses: ./.github/actions/setup
- name: Run specs
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/epets_test
RAILS_ENV: test
SPEC_OPTS: "-f doc --force-color -P spec/controllers/*_spec.rb"
run: |
bundle exec rake spec:controllers
spec-jobs:
runs-on: ubuntu-24.04
services:
postgres:
image: postgres:16
ports: ["5432:5432"]
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
memcached:
image: memcached:1.5
ports: ["11211:11211"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-24.04-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-24.04-gems-
- name: Setup
uses: ./.github/actions/setup
- name: Run specs
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/epets_test
RAILS_ENV: test
SPEC_OPTS: "-f doc --force-color -P spec/jobs/**/*_spec.rb"
run: |
bundle exec rake spec:jobs
spec-mailers:
runs-on: ubuntu-24.04
services:
postgres:
image: postgres:16
ports: ["5432:5432"]
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
memcached:
image: memcached:1.5
ports: ["11211:11211"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-24.04-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-24.04-gems-
- name: Setup
uses: ./.github/actions/setup
- name: Run specs
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/epets_test
RAILS_ENV: test
SPEC_OPTS: "-f doc --force-color -P spec/mailers/**/*_spec.rb"
run: |
bundle exec rake spec
spec-models:
runs-on: ubuntu-24.04
services:
postgres:
image: postgres:16
ports: ["5432:5432"]
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
memcached:
image: memcached:1.5
ports: ["11211:11211"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-24.04-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-24.04-gems-
- name: Setup
uses: ./.github/actions/setup
- name: Run specs
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/epets_test
RAILS_ENV: test
SPEC_OPTS: "-f doc --force-color -P spec/models/**/*_spec.rb"
run: |
bundle exec rake spec
spec-requests:
runs-on: ubuntu-24.04
services:
postgres:
image: postgres:16
ports: ["5432:5432"]
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
memcached:
image: memcached:1.5
ports: ["11211:11211"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-24.04-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-24.04-gems-
- name: Setup
uses: ./.github/actions/setup
- name: Run specs
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/epets_test
RAILS_ENV: test
SPEC_OPTS: "-f doc --force-color -P spec/{requests,routing}/**/*_spec.rb"
run: |
bundle exec rake spec
spec-other:
runs-on: ubuntu-24.04
services:
postgres:
image: postgres:16
ports: ["5432:5432"]
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
memcached:
image: memcached:1.5
ports: ["11211:11211"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-24.04-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-24.04-gems-
- name: Setup
uses: ./.github/actions/setup
- name: Run specs
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/epets_test
RAILS_ENV: test
SPEC_OPTS: "-f doc --force-color -P spec/{helpers,lib,presenters,tasks,validators,views}/**/*_spec.rb"
run: |
bundle exec rake spec
javascript:
runs-on: ubuntu-24.04
services:
postgres:
image: postgres:16
ports: ["5432:5432"]
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
memcached:
image: memcached:1.5
ports: ["11211:11211"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-24.04-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-24.04-gems-
- name: Setup
uses: ./.github/actions/setup
- name: Run javascript specs
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/epets_test
RAILS_ENV: test
run: |
bundle exec rake jasmine:ci
cucumber-admin:
runs-on: ubuntu-24.04
services:
postgres:
image: postgres:16
ports: ["5432:5432"]
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
memcached:
image: memcached:1.5
ports: ["11211:11211"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-24.04-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-24.04-gems-
- name: Setup
uses: ./.github/actions/setup
- name: Save screenshots
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: selenium-screenshots-admin
path: ${{ github.workspace }}/tmp/capybara/*.png
retention-days: 7
if-no-files-found: ignore
- name: Save rails logs
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: rails-logs-admin
path: ${{ github.workspace }}/log/test.log
retention-days: 7
if-no-files-found: ignore
- name: Run cucumber specs
env:
CUCUMBER_FORMAT: pretty
CUCUMBER_OPTS: "--tags @admin --profile default"
DATABASE_URL: postgres://postgres:postgres@localhost:5432/epets_test
RAILS_ENV: test
run: |
bundle exec rake cucumber
cucumber-public:
runs-on: ubuntu-24.04
services:
postgres:
image: postgres:16
ports: ["5432:5432"]
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
memcached:
image: memcached:1.5
ports: ["11211:11211"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-24.04-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-24.04-gems-
- name: Setup
uses: ./.github/actions/setup
- name: Save screenshots
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: selenium-screenshots-public
path: ${{ github.workspace }}/tmp/capybara/*.png
retention-days: 7
if-no-files-found: ignore
- name: Save rails logs
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: rails-logs-public
path: ${{ github.workspace }}/log/test.log
retention-days: 7
if-no-files-found: ignore
- name: Run cucumber specs
env:
CUCUMBER_FORMAT: pretty
CUCUMBER_OPTS: "--tags 'not @admin' --profile default"
DATABASE_URL: postgres://postgres:postgres@localhost:5432/epets_test
RAILS_ENV: test
run: |
bundle exec rake cucumber