39 lines
1.2 KiB
YAML
39 lines
1.2 KiB
YAML
name: Ruby CI
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ruby-latest
|
|
steps:
|
|
- name: Install Node
|
|
run: |
|
|
apt-get update
|
|
apt-get install git ca-certificates curl gnupg --yes
|
|
mkdir -p /etc/apt/keyrings
|
|
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
|
|
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
|
|
apt-get update
|
|
apt-get install -y nodejs
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: vendor/bundle
|
|
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gems-
|
|
- name: Install dependencies
|
|
run: |
|
|
bundle config path vendor/bundle
|
|
bundle install --jobs 4 --retry 3
|
|
- name: autoload
|
|
run: bin/rails zeitwerk:check
|
|
- name: lint
|
|
run: bin/rubocop
|
|
- name: security
|
|
run: bin/brakeman
|
|
- name: test
|
|
run: |
|
|
bin/rails assets:precompile
|
|
bin/rails test
|