-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (72 loc) · 2.46 KB
/
ci.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
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ '**' ]
env:
# these are all referenced in our app's database.yml for test
POSTGRES_HOST: localhost
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
jobs:
tests:
services:
db:
image: postgres:14.3
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports: ['5432:5432']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
# should take ruby version from .ruby-version,
# bundler-cache should be save to use cause we
# have a checked in Gemfile.lock
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: 'pip'
- name: Install python dependencies
run: pip install -r requirements.txt
- name: Install apt dependencies
run: |
sudo apt-get update
sudo apt-get -y install libvips-tools ffmpeg mediainfo tesseract-ocr qpdf imagemagick exiftool poppler-utils ghostscript
# GitHub Actions VMs come with a pre-installed version of node.js - as of early 2024, 18.19.1.
# See package.json under key "engines", which lists allowed versions of node and yarn.
- name: Set up app
run: |
RAILS_ENV=test bundle exec rails db:test:prepare
yarn install
# This cache probably doesn't actually save us any time, but it hopes to save
# us being throttled by apache foundation servers unhappy that solr_wrapper
# is downloading solr over and over again.
- name: Cache solr install
uses: actions/cache@v3
with:
# these paths specified in .solr_wrapper.yml:
path: |
tmp/solr_dist
key: ${{ runner.os }}-solr-${{ hashFiles('.solr_wrapper.yml') }}
- name: Start test Solr
env:
RAILS_ENV: test
run: |
bundle exec rake solr:start
- name: Run tests
run: |
bundle exec rspec
- name: Archive capybara failure screenshots
uses: actions/upload-artifact@v4
if: failure()
with:
name: dist-without-markdown
path: tmp/capybara/*.png
if-no-files-found: ignore