-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (77 loc) · 2.47 KB
/
rails_graphql_federation_users_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
89
90
91
92
93
94
name: rails_graphql_federation users CI
on:
pull_request:
push:
branches: [ main ]
paths: [ rails_graphql_federation/users/** ]
workflow_dispatch:
env:
rails_app_root: rails_graphql_federation/users
CI: true
defaults:
run:
working-directory: rails_graphql_federation/users
jobs:
scan_ruby:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
working-directory: ${{ env.rails_app_root }}
bundler-cache: true
- name: Scan for common Rails security vulnerabilities using static analysis
run: ./bin/brakeman --no-pager
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
working-directory: ${{ env.rails_app_root }}
bundler-cache: true
- name: Lint code for consistent style
run: ./bin/rubocop -f github
rspec:
runs-on: ubuntu-latest
permissions:
contents: read
services:
kafka:
image: bitnami/kafka:latest
env:
KAFKA_ENABLE_KRAFT: yes
KAFKA_CFG_PROCESS_ROLES: broker,controller
KAFKA_CFG_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_CFG_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://127.0.0.1:9092
KAFKA_CFG_NODE_ID: 1
KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: [email protected]:9093
ALLOW_PLAINTEXT_LISTENER: yes
KAFKA_CFG_NUM_PARTITIONS: 4
KAFKA_CFG_OFFSETS_TOPIC_NUM_PARTITIONS: 1
KAFKA_CFG_TRANSACTION_STATE_LOG_NUM_PARTITIONS: 1
KAFKA_CFG_LOG_RETENTION_BYTES: -1
KAFKA_CFG_LOG_RETENTION_HOURS: -1
ports:
- "9092:9092"
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
working-directory: ${{ env.rails_app_root }}
bundler-cache: true
- name: Run RSpec
run: ./bin/rspec --format json --out tmp/rspec_results.json --format progress
- name: Generate RSpec report
uses: SonicGarden/rspec-report-action@v5
with:
json-path: ${{ env.rails_app_root }}/tmp/rspec_results.json
if: always()