-
-
Notifications
You must be signed in to change notification settings - Fork 161
81 lines (79 loc) · 2.2 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
---
name: ci
on:
push:
paths:
- ".github/workflows/ci.yml"
- lib/**
- "*.gemspec"
- spec/**
- Rakefile
- Gemfile
- Gemfile.devtools
- ".rubocop.yml"
- project.yml
pull_request:
branches:
- main
create:
jobs:
tests:
runs-on: ubuntu-latest
name: Tests
strategy:
fail-fast: false
matrix:
ruby:
- '3.3'
- '3.2'
- '3.1'
- '3.0'
# TODO: re-add both as a separate workflow because it's just too slow
# - jruby
# - truffleruby
group: [rom, compat]
include:
- ruby: '3.3'
coverage: 'false'
use_dry_transformer_main: 'true'
use_rom_sql_main: 'true'
env:
COVERAGE: "${{matrix.coverage}}"
COVERAGE_TOKEN: "${{secrets.CODACY_PROJECT_TOKEN}}"
BASE_DB_URI: localhost/rom_repository
USE_DRY_TRANSFORMER_MAIN: "${{matrix.use_dry_transformer_main}}"
USE_ROM_SQL_MAIN: "${{matrix.use_rom_sql_main}}"
CODACY_RUN_LOCAL: "${{matrix.coverage}}"
CODACY_PROJECT_TOKEN: "${{secrets.CODACY_PROJECT_TOKEN}}"
APT_DEPS: libpq-dev libsqlite3-dev
SPEC_GROUP: "${{matrix.group}}"
services:
postgres:
image: postgres:16.2
env:
POSTGRES_USER: runner
POSTGRES_PASSWORD: ''
POSTGRES_DB: rom_repository
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
options: "--health-cmd pg_isready --health-interval 10s --health-timeout 5s
--health-retries 5"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install package dependencies
run: "[ -e $APT_DEPS ] || sudo apt-get install -y --no-install-recommends $APT_DEPS"
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "${{matrix.ruby}}"
bundler-cache: true
- name: Run tests
run: bundle exec rake spec:$SPEC_GROUP
- name: Run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@master
if: env.COVERAGE == 'true' && env.COVERAGE_TOKEN != ''
with:
project-token: "${{secrets.CODACY_PROJECT_TOKEN}}"
coverage-reports: coverage/coverage.xml