Files
ruby-sea-battle/.github/workflows/ci.yml
T
Slavasil bbb01cc61c
CI / main-server (RSpec + audits) (push) Failing after 5m51s
CI / game-server (go vet + go test -race) (push) Successful in 21s
CI / frontend (build + tests) (push) Successful in 7s
fix ruby version for ci
2026-11-30 20:10:49 +03:00

70 lines
1.7 KiB
YAML

name: CI
on:
push:
branches: [master, main]
pull_request:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
main-server:
name: main-server (RSpec + audits)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
# Runs `bundle install` + caches gems; resolves the Gemfile
# and .ruby-version inside main-server/.
- uses: ruby/setup-ruby@v1
with:
working-directory: main-server
ruby-version: '4.0'
bundler-cache: true
# The spec suite talks to a real Redis: test runs are forced onto
# logical database 15 (config/initializers/redis.rb) and FLUSHDB it.
- name: Start Redis
run: |
if ! command -v redis-server >/dev/null 2>&1; then
sudo apt-get update -qq
sudo apt-get install -y -qq redis-server
fi
redis-server --daemonize yes
redis-cli -n 15 ping
- name: db:prepare, rubocop, bundler-audit, brakeman, rspec
run: scripts/test.sh main
game-server:
name: game-server (go vet + go test -race)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version-file: game-server/go.mod
cache-dependency-path: game-server/go.sum
- run: scripts/test.sh game
frontend:
name: frontend (build + tests)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 24
cache: npm
cache-dependency-path: frontend/package-lock.json
- run: scripts/test.sh frontend --install