Merge branch 'master' into validation-checkbox

This commit is contained in:
Kyle Drake 2022-11-16 15:49:16 -06:00
commit caf57bfb07
11 changed files with 58 additions and 27 deletions

41
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,41 @@
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-22.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: 3.1
bundler-cache: true
- run: sudo apt-get -y install chromium-browser
- run: bundle exec rake

View file

@ -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

View file

@ -29,7 +29,7 @@ gem 'geoip'
gem 'io-extra', require: 'io/extra'
#gem 'rye'
gem 'base32'
gem 'coveralls', require: false
gem 'coveralls_reborn', require: false
gem 'sanitize'
gem 'will_paginate'
gem 'simpleidn'

View file

@ -50,12 +50,11 @@ GEM
coderay (1.1.3)
concurrent-ruby (1.1.10)
connection_pool (2.3.0)
coveralls (0.7.1)
multi_json (~> 1.3)
rest-client
simplecov (>= 0.7)
term-ansicolor
thor
coveralls_reborn (0.25.0)
simplecov (>= 0.18.1, < 0.22.0)
term-ansicolor (~> 1.6)
thor (>= 0.20.3, < 2.0)
tins (~> 1.16)
crack (0.4.5)
rexml
crass (1.0.6)
@ -318,7 +317,7 @@ DEPENDENCIES
bcrypt
capybara
certified
coveralls
coveralls_reborn
dav4rack!
erubis
fabrication

View file

@ -2,7 +2,7 @@
# Neocities.org
[![Build Status](https://travis-ci.org/neocities/neocities.png?branch=master)](https://travis-ci.org/neocities/neocities)
[![Build Status](https://github.com/neocities/neocities/actions/workflows/ci.yml/badge.svg)](https://github.com/neocities/neocities/actions?query=workflow%3ACI)
[![Coverage Status](https://coveralls.io/repos/neocities/neocities/badge.svg?branch=master&service=github)](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!

View file

@ -119,7 +119,7 @@ def flash_display(opts={})
end
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']
resp = Net::HTTP.get URI(

View file

@ -1,4 +1,4 @@
database: 'postgres://postgres@localhost/travis_ci_test'
database: 'postgres://postgres:citestpassword@localhost/ci_test'
database_pool: 1
session_secret: 's3cr3t'
email_unsubscribe_token: "somethingrandomderrrrp"

View file

@ -24,8 +24,8 @@ end
Dir['./ext/**/*.rb'].each {|f| require f}
# :nocov:
if ENV['TRAVIS']
$config = YAML.load_file File.join(DIR_ROOT, 'config.yml.travis')
if ENV['CI']
$config = YAML.load_file File.join(DIR_ROOT, 'config.yml.ci')
else
begin
$config = YAML.load_file(File.join(DIR_ROOT, 'config.yml'))[ENV['RACK_ENV']]

View file

@ -720,8 +720,8 @@ class Site < Sequel::Model
return false unless valid_file_mime_type_and_ext?(mime_type, extname)
# clamdscan doesn't work on travis for testing
return true if ENV['TRAVIS'] == 'true'
# clamdscan doesn't work on continuous integration for testing
return true if ENV['CI'] == 'true'
File.chmod 0666, uploaded_file[:tempfile].path
line = Terrapin::CommandLine.new(

View file

@ -2,7 +2,7 @@ require_relative '../environment.rb'
describe ArchiveWorker do
it 'stores an IPFS archive' do
return if ENV['TRAVIS']
return if ENV['CI']
site = Fabricate :site
ipfs_hash = site.add_to_ipfs
ArchiveWorker.new.perform site.id

View file

@ -16,6 +16,8 @@
<meta property="og:description" content="Neocities is the new Geocities. Create your own free home page, and do whatever you want with it.">
<meta name="referrer" content="no-referrer-when-downgrade">
<link rel="canonical" href="https://neocities.org<%= request.fullpath %>" />
<% if meta_robots %>
<meta name="robots" content="<%= meta_robots %>">
<% end %>