-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (66 loc) · 2.1 KB
/
Copy pathci.yml
File metadata and controls
68 lines (66 loc) · 2.1 KB
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
name: CI
on: [push, pull_request]
jobs:
RSpec:
runs-on: ubuntu-18.04
strategy:
fail-fast: false
env:
DB: postgresql
DB_USER: alchemy_user
DB_PASSWORD: password
DB_HOST: "127.0.0.1"
RAILS_ENV: test
services:
postgres:
image: postgres:11
env:
POSTGRES_USER: alchemy_user
POSTGRES_PASSWORD: password
POSTGRES_DB: alchemy-graphql_dummy_test
ports: ["5432:5432"]
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v2.3.4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- name: Restore apt cache
id: apt-cache
uses: actions/cache@v2.1.3
with:
path: /home/runner/apt/cache
key: ${{ runner.os }}-apt-${{ matrix.database }}
restore-keys: |
${{ runner.os }}-apt-
- name: Install Postgres headers
if: matrix.database == 'postgresql'
run: |
mkdir -p /home/runner/apt/cache
sudo apt update -qq
sudo apt install -qq --fix-missing libpq-dev -o dir::cache::archives="/home/runner/apt/cache"
sudo chown -R runner /home/runner/apt/cache
- name: Restore node modules cache
id: yarn-cache
uses: actions/cache@v2.1.3
with:
path: spec/dummy/node_modules
key: ${{ runner.os }}-yarn-dummy-${{ hashFiles('./package.json') }}
restore-keys: |
${{ runner.os }}-yarn-dummy-
- name: Prepare database
run: |
bundle exec rake db:test:prepare
- name: Run tests & publish code coverage
uses: paambaati/codeclimate-action@v2.7.5
env:
CC_TEST_REPORTER_ID: 3633d87966885158f7a3c69bacea0e24b65e35ff04aa6df23170a3d1a8415691
with:
coverageCommand: bundle exec rspec
- uses: actions/upload-artifact@main
if: failure()
with:
name: Screenshots
path: spec/dummy/tmp/screenshots