Refactor Workflow Execution Jobs codeflow #11003
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Ruby CI | |
on: | |
pull_request: | |
branches: [main] | |
push: | |
branches: [main] | |
jobs: | |
test: | |
timeout-minutes: 20 | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:14.17 | |
env: | |
POSTGRES_DB: irida_next_test | |
POSTGRES_PASSWORD: test | |
POSTGRES_USER: test | |
POSTGRES_HOST: postgres | |
ports: | |
- 5432:5432 | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
validator: | |
image: ghcr.io/validator/validator:latest | |
env: | |
VALIDATOR_HOST: validator | |
ports: | |
- 8888:8888 | |
steps: | |
- name: Install packages | |
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y curl libjemalloc2 libvips | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
- name: Set up PNPM | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 10 | |
- name: Use Node.js 24 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 24 | |
cache: "pnpm" | |
- name: Install dependencies | |
run: pnpm install | |
- name: Install icons | |
run: | | |
bin/rails generate rails_icons:install --libraries=phosphor heroicons | |
- name: Precompile assets | |
run: | | |
bin/rails assets:precompile | |
- name: Run tests | |
run: | | |
bin/rails test:all --exclude test/integration/integration_sapporo_test.rb | |
- name: Keep screenshots from failed system tests | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: screenshots | |
path: ${{ github.workspace }}/tmp/capybara/screenshots | |
if-no-files-found: ignore | |
- name: Report coverage | |
if: github.event_name == 'pull_request' | |
uses: k1LoW/octocov-action@v1 |