Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ The only inputs are for the linting and non system test action. Neither are requ
Here's what your `ci.yml` file could look like

```yaml
name: "CI"
name: CI
on:
push:
branches: ["master"]
branches: [ main, master ]
pull_request:

concurrency:
Expand All @@ -53,7 +53,7 @@ concurrency:
env:
CI: true
RAILS_ENV: test
HONEYBADGER_SOURCE_MAP_DISABLED: 'true'
HONEYBADGER_SOURCE_MAP_DISABLED: true
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
SECRET_KEY_BASE: 0cb2b4ae6543f334e0eb5bc88bdabc24c9e5155ecb02a175c6f073a5a0d45a45f4a5b7d1288d3b412307bdfa19be441e97960ec4cd344f91f2d06a2595fb239c
Expand All @@ -77,14 +77,13 @@ jobs:
runs-on: blacksmith-8vcpu-ubuntu-2204
timeout-minutes: 5
needs: compile_assets
if: always() && (needs.compile_assets.outputs.cache-hit == 'true' || (needs.compile_assets.result == 'success'))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. use of always() doesn't make sense with a conditional.
  2. checking cache-hit is unnecessary, because the compile_assets action will report 'success' so long as it did not fail, whether it actually compiled or there was a cache hit.
  3. if is redundant because compile_assets is specified as a "need" for the system-test job. i.e. system-test will be skipped if compile_assets fails.

reference: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idneeds

services:
postgres:
image: postgres:16
ports:
- "5432:5432"
env:
POSTGRES_USER: root
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password

steps:
Expand All @@ -101,29 +100,32 @@ jobs:
name: Ruby System Tests
runs-on: blacksmith-16vcpu-ubuntu-2204
timeout-minutes: 10
if: always() && (needs.compile_assets.outputs.cache-hit == 'true' || (needs.compile_assets.result == 'success'))
needs: compile_assets
services:
postgres:
image: postgres:16
ports:
- "5432:5432"
env:
POSTGRES_USER: root
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password

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

# allows for custom install steps if needed
# allows for custom install steps between checkout & test run if needed
- name: Setup vips
run: |
sudo apt-get update
sudo apt-get install -y libvips
sudo apt-get update
sudo apt-get install -y libvips

- name: Run shared flow
uses: RoleModel/actions/system-tests@v2
# if you've configured capybara to be compatible with the tmp:clear task
# you can tell the system-tests action like this:
with:
failure-screenshot-dir: tmp/screenshots
```

## Versioning
Expand Down
11 changes: 8 additions & 3 deletions system-tests/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: 'Ruby System Tests'
description: 'Runs Ruby system tests'
name: Ruby System Tests
description: Runs Ruby system tests
inputs:
failure-screenshot-dir:
description: tmp directory where your tests save failure screenshots to
required: false
default: tmp/capybara

runs:
using: "composite"
Expand Down Expand Up @@ -81,7 +86,7 @@ runs:
uses: actions/upload-artifact@v4
with:
name: rspec-screenshots
path: tmp/capybara
path: ${{ inputs.failure-screenshot-dir }}

- name: Cleanup
uses: RoleModel/actions/test-cleanup@v1
Expand Down