-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (77 loc) · 2.76 KB
/
future_proof.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
# This file ensures that the codebase is compatible with newer ruby and gem versions
name: Future proof
on:
pull_request:
types: [opened, ready_for_review, review_requested]
permissions:
contents: read
actions: read
jobs:
future_proof_matrix:
strategy:
fail-fast: false
matrix:
ruby-version:
- '3.1' # Latest ruby 3.1.x
- '3.2' # Latest ruby 3.2.x
name: "Ruby ${{ matrix.ruby-version }} Smoke Tests"
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_USER: rails
POSTGRES_PASSWORD: ra1ls_password
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
--name postgres
ports:
- 5432:5432
env:
DB_HOST: localhost
DB_PORT: 5432
DB_USERNAME: rails
DB_PASSWORD: ra1ls_password
# Prep the whole stack in test-only mode:
RAILS_ENV: test
# TODO: Install apache-arrow, parquet-glib-devel etc., remove rdc from the following line:
# TODO: Install oracle client libraries, remove oracle from the following line:
BUNDLE_WITHOUT: rdc:oracle
steps:
- uses: actions/checkout@v3
- name: Remove Gemfile.lock so we get the latest gems
run: rm Gemfile.lock
- name: Set up Ruby + Bundle
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ${{ matrix.ruby-version }}
- name: Inject configuration
run: cp config/database.yml{.ci,}
- name: Prepare the database
run: bin/rails db:setup
- name: Precompile assets
# Since ruby/setup-ruby@v1 moved to Node.js v18 we need the extra options
# until we move to newer webpacker / stop using it.
# I've tried using a newer hash function in config/webpack/environment.js
# by adding the following line, but this didn't help with github actions
# # environment.config.set('output.hashFunction', 'sha256')
# https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported/73465262#73465262
run: NODE_OPTIONS=--openssl-legacy-provider RAILS_GROUPS=assets RAILS_ENV=test bin/rails yarn:install assets:clobber assets:precompile
- name: Run smoke tests with latest gems and ruby
run: bin/rake smoke_test
# A utility job upon which Branch Protection can depend,
# thus remaining agnostic of the matrix.
future_proofs:
if: ${{ always() }}
runs-on: ubuntu-latest
# name: Matrix
needs: future_proof_matrix
steps:
- name: Check build matrix status
if: ${{ needs.future_proof_matrix.result != 'success' }}
run: exit 1