mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
Merge branch 'talklittle-github-actions'
This commit is contained in:
commit
0d49ac2213
8 changed files with 49 additions and 19 deletions
41
.github/workflows/ci.yml
vendored
Normal file
41
.github/workflows/ci.yml
vendored
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
name: CI
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres
|
||||||
|
env:
|
||||||
|
POSTGRES_DB: ci_test
|
||||||
|
POSTGRES_PASSWORD: citestpassword
|
||||||
|
# Set health checks to wait until postgres has started
|
||||||
|
options: >-
|
||||||
|
--health-cmd pg_isready
|
||||||
|
--health-interval 10s
|
||||||
|
--health-timeout 5s
|
||||||
|
--health-retries 5
|
||||||
|
ports:
|
||||||
|
# Maps tcp port 5432 on service container to the host
|
||||||
|
- 5432:5432
|
||||||
|
redis:
|
||||||
|
image: redis
|
||||||
|
# Set health checks to wait until redis has started
|
||||||
|
options: >-
|
||||||
|
--health-cmd "redis-cli ping"
|
||||||
|
--health-interval 10s
|
||||||
|
--health-timeout 5s
|
||||||
|
--health-retries 5
|
||||||
|
ports:
|
||||||
|
# Maps port 6379 on service container to the host
|
||||||
|
- 6379:6379
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: ruby/setup-ruby@v1
|
||||||
|
with:
|
||||||
|
ruby-version: 2.6
|
||||||
|
bundler-cache: true
|
||||||
|
- run: sudo apt-get -y install chromium-browser
|
||||||
|
- run: bundle exec rake
|
11
.travis.yml
11
.travis.yml
|
@ -1,11 +0,0 @@
|
||||||
language: ruby
|
|
||||||
rvm:
|
|
||||||
- "2.6.0"
|
|
||||||
services:
|
|
||||||
- redis-server
|
|
||||||
- postgresql
|
|
||||||
before_script:
|
|
||||||
- psql -c 'create database travis_ci_test;' -U postgres
|
|
||||||
sudo: false
|
|
||||||
bundler_args: --jobs=1
|
|
||||||
before_install: gem install bundler
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
# Neocities.org
|
# Neocities.org
|
||||||
|
|
||||||
[](https://travis-ci.org/neocities/neocities)
|
[](https://github.com/neocities/neocities/actions?query=workflow%3ACI)
|
||||||
[](https://coveralls.io/github/neocities/neocities?branch=master)
|
[](https://coveralls.io/github/neocities/neocities?branch=master)
|
||||||
|
|
||||||
The web site for Neocities! It's open source. Want a feature on the site? Send a pull request!
|
The web site for Neocities! It's open source. Want a feature on the site? Send a pull request!
|
||||||
|
|
|
@ -119,7 +119,7 @@ def flash_display(opts={})
|
||||||
end
|
end
|
||||||
|
|
||||||
def hcaptcha_valid?
|
def hcaptcha_valid?
|
||||||
return true if ENV['RACK_ENV'] == 'test' || ENV['TRAVIS']
|
return true if ENV['RACK_ENV'] == 'test' || ENV['CI']
|
||||||
return false unless params[:'h-captcha-response']
|
return false unless params[:'h-captcha-response']
|
||||||
|
|
||||||
resp = Net::HTTP.get URI(
|
resp = Net::HTTP.get URI(
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
database: 'postgres://postgres@localhost/travis_ci_test'
|
database: 'postgres://postgres:citestpassword@localhost/ci_test'
|
||||||
database_pool: 1
|
database_pool: 1
|
||||||
session_secret: 's3cr3t'
|
session_secret: 's3cr3t'
|
||||||
email_unsubscribe_token: "somethingrandomderrrrp"
|
email_unsubscribe_token: "somethingrandomderrrrp"
|
|
@ -24,8 +24,8 @@ end
|
||||||
Dir['./ext/**/*.rb'].each {|f| require f}
|
Dir['./ext/**/*.rb'].each {|f| require f}
|
||||||
|
|
||||||
# :nocov:
|
# :nocov:
|
||||||
if ENV['TRAVIS']
|
if ENV['CI']
|
||||||
$config = YAML.load_file File.join(DIR_ROOT, 'config.yml.travis')
|
$config = YAML.load_file File.join(DIR_ROOT, 'config.yml.ci')
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
$config = YAML.load_file(File.join(DIR_ROOT, 'config.yml'))[ENV['RACK_ENV']]
|
$config = YAML.load_file(File.join(DIR_ROOT, 'config.yml'))[ENV['RACK_ENV']]
|
||||||
|
|
|
@ -720,8 +720,8 @@ class Site < Sequel::Model
|
||||||
|
|
||||||
return false unless valid_file_mime_type_and_ext?(mime_type, extname)
|
return false unless valid_file_mime_type_and_ext?(mime_type, extname)
|
||||||
|
|
||||||
# clamdscan doesn't work on travis for testing
|
# clamdscan doesn't work on continuous integration for testing
|
||||||
return true if ENV['TRAVIS'] == 'true'
|
return true if ENV['CI'] == 'true'
|
||||||
|
|
||||||
File.chmod 0666, uploaded_file[:tempfile].path
|
File.chmod 0666, uploaded_file[:tempfile].path
|
||||||
line = Terrapin::CommandLine.new(
|
line = Terrapin::CommandLine.new(
|
||||||
|
|
|
@ -2,7 +2,7 @@ require_relative '../environment.rb'
|
||||||
|
|
||||||
describe ArchiveWorker do
|
describe ArchiveWorker do
|
||||||
it 'stores an IPFS archive' do
|
it 'stores an IPFS archive' do
|
||||||
return if ENV['TRAVIS']
|
return if ENV['CI']
|
||||||
site = Fabricate :site
|
site = Fabricate :site
|
||||||
ipfs_hash = site.add_to_ipfs
|
ipfs_hash = site.add_to_ipfs
|
||||||
ArchiveWorker.new.perform site.id
|
ArchiveWorker.new.perform site.id
|
||||||
|
|
Loading…
Add table
Reference in a new issue