-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (69 loc) · 2.22 KB
/
ci.yml
File metadata and controls
70 lines (69 loc) · 2.22 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
69
70
# This workflow uses actions that are not certified by GitHub. They are
# provided by a third-party and are governed by separate terms of service,
# privacy policy, and support documentation.
#
# This workflow will install a prebuilt Ruby version, install dependencies, and
# run tests and linters.
name: "CI"
on:
pull_request:
branches: ['*']
# push:
# branches: [main]
jobs:
test:
runs-on: ubuntu-latest
services:
db:
image: mysql:8.1
ports:
- 3306:3306
env:
MYSQL_DATABASE: kucharka_test
MYSQL_USER: kucharka
MYSQL_PASSWORD: kucharka
MYSQL_ROOT_PASSWORD: kucharka
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
env:
RAILS_ENV: test
DATABASE_URL: "mysql2://kucharka:kucharka@127.0.0.1:3306/kucharka_test"
steps:
- name: Checkout code
uses: actions/checkout@v4
# Add or replace dependency steps here
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1 # v1.146.0
with:
bundler-cache: true
# Add or replace database setup steps here
- name: Set up database schema
run: bin/rails db:drop db:setup
# Add or replace test runners here
- name: Prepare assets
run: bin/rails assets:precompile
- name: Run tests
run: bin/rails test
- name: Run specs
run: bundle exec rspec
- name: Keep screenshots from failed system tests
uses: actions/upload-artifact@v4
if: failure()
with:
name: screenshots
path: ${{ github.workspace }}/tmp/screenshots
if-no-files-found: ignore
security:
runs-on: ubuntu-latest
steps: # This was corrected to address https://github.com/actions/starter-workflows/issues/2159
- name: Checkout code
uses: actions/checkout@v4
# Add or replace dependency steps here
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1 # v1.146.0
with:
bundler-cache: true
- name: Formatting and Security Checks
run: |
bundle exec brakeman -z
bundle exec bundle-audit update
bundle exec bundle-audit