-
Notifications
You must be signed in to change notification settings - Fork 7
73 lines (71 loc) · 1.84 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
name: CI
on:
push:
paths-ignore:
- '.github/**'
- '!.github/workflows/ci.yml'
- '**.md'
branches:
- main
pull_request:
paths-ignore:
- '.github/**'
- '!.github/workflows/ci.yml'
- '**.md'
branches:
- main
types: [opened, synchronize]
jobs:
run-test:
runs-on: ubuntu-24.04
permissions:
pull-requests: write
if: github.event.pusher.name != 'dreamkast-cloudnativedays'
steps:
- uses: actions/checkout@v4
- name: dependencies
run: |
sudo apt update
sudo apt-get install -y libvips42 libmysqlclient21 libyaml-dev
sudo ln -s /usr/lib/x86_64-linux-gnu/libffi.so.7.1.0 /usr/lib/x86_64-linux-gnu/libffi.so.6
- name: Run database
shell: bash
run: |
docker compose up -d db redis
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'yarn'
- name: yarn install
run: |
yarn
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '.ruby-version'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run rubocop
run: |
bundle exec rubocop
- name: Prepare tests
shell: bash
env:
COVERAGE: true
run: |
bundle exec rails db:create RAILS_ENV=test
bundle exec rails db:environment:set RAILS_ENV=test
bundle exec rails db:migrate RAILS_ENV=test
bundle exec rake ci:check_git_diff
bundle exec rake assets:precompile
- name: Run tests
shell: bash
env:
COVERAGE: true
run: |
bundle exec rspec
- name: Simplecov Report
uses: aki77/simplecov-report-action@v1
with:
failedThreshold: 60
token: ${{ secrets.GITHUB_TOKEN }}