-
Notifications
You must be signed in to change notification settings - Fork 759
119 lines (115 loc) · 4.24 KB
/
ruby.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
name: Ruby
on:
push:
branches:
- 'master'
pull_request:
jobs:
check_react_and_ujs:
strategy:
fail-fast: true
matrix:
ruby: [2.7]
runs-on: ubuntu-latest
env:
PACKAGE_JSON_FALLBACK_MANAGER: yarn_classic
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v3
- name: Save root node_modules to cache
uses: actions/cache@v3
with:
path: node_modules
key: package-node-modules-cache-${{ hashFiles('yarn.lock') }}
- name: Save react-builds/node_modules to cache
uses: actions/cache@v3
with:
path: react-builds/node_modules
key: dummy-app-node-modules-cache-${{ hashFiles('react-builds/yarn.lock') }}
- uses: ruby/setup-ruby@v1
with:
bundler: 2.4.9
ruby-version: ${{ matrix.ruby }}
- name: Save dummy app ruby gems to cache
uses: actions/cache@v3
with:
path: vendor/bundle
key: root-gem-cache-${{ hashFiles('Gemfile.lock') }}
- name: Install Ruby Gems
run: bundle lock --add-platform 'x86_64-linux' && bundle check --path=vendor/bundle || bundle _2.4.9_ install --path=vendor/bundle --jobs=4 --retry=3
- run: yarn
- run: bundle exec rake react:update
- run: bundle exec rake ujs:update
- run: ./check_for_uncommitted_files.sh
test:
needs: check_react_and_ujs
strategy:
fail-fast: false
matrix:
js_package_manager:
- name: npm
installer: npm
- name: yarn_classic
installer: yarn
- name: pnpm
installer: pnpm
- name: bun
installer: bun
ruby: [2.7]
gemfile:
# These have shakapacker:
- base
- shakapacker
# These don't have shakapacker:
- sprockets_3
- sprockets_4
runs-on: ubuntu-latest
env:
# $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
# Workaround b/c upgrading Minitest broke some mocking expectations
# having to do with automatic kwarg splatting
MT_KWARGS_HACK: 1
PACKAGE_JSON_FALLBACK_MANAGER: ${{ matrix.js_package_manager.name }}
SHAKAPACKER_USE_PACKAGE_JSON_GEM: true
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v3
- run: npm -g install yalc ${{ matrix.js_package_manager.installer }}
- run: yalc publish
- name: Save root node_modules to cache
uses: actions/cache@v3
with:
path: node_modules
key: package-node-modules-cache-${{ hashFiles('yarn.lock') }}
- name: Save test/dummy/node_modules to cache
uses: actions/cache@v3
with:
path: test/dummy/node_modules
key: dummy-app-node-modules-cache-${{ hashFiles('test/dummy/yarn.lock') }}
- uses: ruby/setup-ruby@v1
with:
bundler: 2.4.9
ruby-version: ${{ matrix.ruby }}
- run: ./test/bin/create-fake-js-package-managers ${{ matrix.js_package_manager.installer }}
- name: Save dummy app ruby gems to cache
uses: actions/cache@v3
with:
path: test/dummy/vendor/bundle
key: dummy-app-gem-cache-${{ hashFiles('${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile.lock') }}
- name: Install Ruby Gems for dummy app
run: bundle lock --add-platform 'x86_64-linux' && bundle check --path=test/dummy/vendor/bundle || bundle _2.4.9_ install --frozen --path=test/dummy/vendor/bundle --jobs=4 --retry=3
- run: cd test/dummy && yalc add react_ujs && ${{ matrix.js_package_manager.installer }} install
- run: bundle exec rake test
env:
NODE_OPTIONS: --openssl-legacy-provider