-
Notifications
You must be signed in to change notification settings - Fork 5
46 lines (42 loc) · 1.3 KB
/
main.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
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
rspec:
runs-on: ubuntu-latest
name: RSpec (Ruby ${{ matrix.ruby }})
strategy:
matrix:
ruby:
- "3.1" # Minimum supported version
- "3.2"
- "3.3"
- "ruby" # Latest stable version
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run RSpec
run: bundle exec rspec
validate-yaml:
runs-on: ubuntu-latest
name: Validate YAML
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm install -g ajv-cli
- name: Validate merchants.yaml
run: ajv -s lib/yellow_pages/merchants.schema.json -d lib/yellow_pages/merchants.yaml --errors=text
- name: Validate unique network_ids in merchants.yaml
run: |
DUPLICATES="$(yq 'map(.network_ids) | flatten | sort' lib/yellow_pages/merchants.yaml | uniq -cd)"
echo "::error ::${DUPLICATES}"
if [[ DUPLICATES ]]; then exit 1; else exit 0; fi
- name: Validate categories.yaml
run: ajv -s lib/yellow_pages/categories.schema.json -d lib/yellow_pages/categories.yaml --errors=text