Skip to content

Commit 701af47

Browse files
committed
Add Github action for CI
1 parent ca4ddc8 commit 701af47

File tree

2 files changed

+64
-73
lines changed

2 files changed

+64
-73
lines changed

.circleci/config.yml

Lines changed: 0 additions & 73 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '*'
7+
push:
8+
branches:
9+
- main
10+
workflow_call:
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
ruby: ['3.0', '3.1', '3.2', '3.3']
18+
gemfile:
19+
- rails_6.0
20+
- rails_6.1
21+
- rails_7.0
22+
- rails_7.1
23+
# Example for excluding a specific Ruby version with a specific Gemfile
24+
# exclude:
25+
# - ruby: '3.0'
26+
# gemfile: 'rails_7.1'
27+
28+
env:
29+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
30+
BUNDLE_PATH_RELATIVE_TO_CWD: true
31+
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- name: Set up Ruby
36+
uses: ruby/setup-ruby@v1
37+
with:
38+
ruby-version: ${{ matrix.ruby }}
39+
bundler: default
40+
bundler-cache: true
41+
rubygems: latest
42+
43+
- name: Setup Node
44+
uses: actions/setup-node@v4
45+
with:
46+
node-version-file: .node-version
47+
cache: yarn
48+
cache-dependency-path: './test/sample/yarn.lock'
49+
50+
- name: Node version
51+
run: |
52+
node --version
53+
54+
- name: Install NPM packages for sample app
55+
run: |
56+
bundle exec rake app:yarn_install_frozen
57+
58+
- name: StandardRb check
59+
run: bundle exec standardrb
60+
61+
- name: Run tests
62+
run: |
63+
bundle exec rails db:test:prepare
64+
bundle exec rails test

0 commit comments

Comments
 (0)