2
0
mirror of https://github.com/moebooru/moebooru synced 2025-08-22 01:47:48 +00:00

Add github action

This commit is contained in:
nanaya 2021-10-13 03:17:35 +09:00
parent d5b846f4ca
commit 2ff151a134
3 changed files with 46 additions and 22 deletions

44
.github/workflows/tests.yml vendored Normal file
View File

@ -0,0 +1,44 @@
name: Tests
on: [push, pull_request]
env:
RAILS_ENV: test
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14
env:
POSTGRES_PASSWORD: postgres
ports: ['5432:5432']
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
memcached:
image: memcached:alpine
ports: ['11211:11211']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- name: Setup environment
run: ./script/gh-action-prepare
- name: Build assets
run: bundle exec rails assets:precompile
- name: Run test
run: bundle exec rails test

View File

@ -1,22 +0,0 @@
dist: focal
cache:
bundler: true
yarn: true
language: ruby
rvm:
- 2.7.1
services:
- memcached
- postgresql
addons:
postgresql: 13
before_script:
- nvm use 12
- yarn install
- script/travis_prepare

View File

@ -5,8 +5,10 @@ mkdir -p public/data
cat <<EOF > config/database.yml
test:
adapter: postgresql
host: '127.0.0.1'
port: 5432
username: postgres
password: postgres
database: moebooru_test
EOF