forked from ankane/searchkick
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (77 loc) · 2.4 KB
/
test_and_build.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
name: Test and Build
on: [push]
jobs:
verify_gemfile_lock:
runs-on: ubuntu-latest
env:
BUNDLE_RUBYGEMS__PKG__GITHUB__COM: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: checkout
uses: actions/[email protected]
- name: Setup upterm session
uses: lhotari/action-upterm@v1
with:
## If no one connects after 5 minutes, shut down server.
wait-timeout-minutes: 5
- name: setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.3
bundler-cache: true # runs 'bundle install' and caches installed gems
- name: bundler
shell: bash
run: |-
gem install bundler -v $(grep 'BUNDLED WITH' Gemfile.lock -A 1|tail -1)
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Verify Gemfile.lock
shell: bash
run: |-
if git diff-index --quiet HEAD -- Gemfile.lock
then
exit 0
else
echo "Please ensure that you have bundled and committed any"
echo "resulting changes to the Gemfile.lock file in this repo."
git --no-pager diff -- Gemfile.lock
exit 128
fi
test_and_build:
runs-on: ubuntu-latest
env:
BUNDLE_RUBYGEMS__PKG__GITHUB__COM: ${{ secrets.GITHUB_TOKEN }}
services:
redis:
image: redis
ports:
- 6379:6379
options: --entrypoint redis-server
steps:
- name: checkout
uses: actions/[email protected]
- uses: ankane/setup-elasticsearch@v1
with:
elasticsearch-version: 7.10.2
plugins: |
analysis-kuromoji
analysis-smartcn
analysis-stempel
analysis-ukrainian
- name: setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.3
bundler-cache: true # runs 'bundle install' and caches installed gems
- name: bundler
shell: bash
run: |-
gem install bundler -v $(grep 'BUNDLED WITH' Gemfile.lock -A 1|tail -1)
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: specs
shell: bash
run: |-
# Run specs to ensure build is passing
bundle exec rake test
# Run rake build to ensure gem will build
bundle exec rake build