This repository has been archived by the owner on Sep 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
108 lines (86 loc) · 2.7 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
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: main
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ["3.2", "3.1", "3.0"]
rails-version: ["7.1", "7.0", "6.1"]
fail-fast: false
env:
BUNDLE_WITHOUT: 'development'
BUNDLE_GEMFILE: "${{ github.workspace }}/gemfiles/rails_${{matrix.rails-version}}.gemfile"
steps:
- uses: actions/checkout@v3
- name: Set up Ruby ${{ matrix.ruby-version }} / Rails ${{ matrix.rails-version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Read Node Version
id: node-version
run: |
version=$(cat .tool-versions| grep nodejs | cut -d' ' -f2)
echo "::set-output name=version::$version"
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '${{ steps.node-version.outputs.version }}'
cache: 'npm'
- name: Install Packages
uses: bahmutov/npm-install@v1
- name: Compile Assets
run: npm run build
- name: Setup DB 🗄️
run: |
bin/rake db:test:prepare
- name: Run Tests ✅
run: |
bin/rake spec
env:
COVERAGE: true
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
- name: Report Coverage
# We don't need to upload coverage multiple times, just do it for latest versions, and only on master
if: github.ref == 'refs/heads/main' && matrix.ruby-version == 3.0 && matrix.rails-version == 7.0
uses: paambaati/[email protected]
with:
coverageLocations: |
${{github.workspace}}/coverage/coverage.json:simplecov
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Read Node Version
id: node-version
run: |
version=$(cat .tool-versions| grep nodejs | cut -d' ' -f2)
echo "::set-output name=version::$version"
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '${{ steps.node-version.outputs.version }}'
cache: 'npm'
- name: Install Packages
uses: bahmutov/npm-install@v1
- name: Run RuboCop 🚓
run: bundle exec rake rubocop
- name: Run JS Linter 🔎
run: npm run lint
- name: Run SCSS Linter ✨
run: npm run lint:scss
- name: Lint Commits 📝
uses: wagoid/commitlint-github-action@v5