Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Aug 26, 2023
1 parent 91f2bc7 commit 0d24166
Show file tree
Hide file tree
Showing 86 changed files with 361 additions and 974 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Coverage

on: [push, pull_request]

permissions:
contents: read

env:
CONSOLE_OUTPUT: XTerm
COVERAGE: PartialSummary

jobs:
test:
name: ${{matrix.ruby}} on ${{matrix.os}}
runs-on: ${{matrix.os}}-latest

strategy:
matrix:
os:
- ubuntu
- macos

ruby:
- "3.2"

steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{matrix.ruby}}
bundler-cache: true

- name: Run tests
timeout-minutes: 5
run: bundle exec bake test

- uses: actions/upload-artifact@v2
with:
name: coverage-${{matrix.os}}-${{matrix.ruby}}
path: .covered.db

validate:
needs: test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
bundler-cache: true

- uses: actions/download-artifact@v3

- name: Validate coverage
timeout-minutes: 5
run: bundle exec bake covered:validate --paths */.covered.db \;
42 changes: 31 additions & 11 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,61 @@
name: Documentation

permissions:
contents: write

on:
push:
branches:
- main

# Allows you to run this workflow manually from the Actions tab:
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages:
permissions:
contents: write
contents: read
pages: write
id-token: write

# Allow one concurrent deployment:
concurrency:
group: "pages"
cancel-in-progress: true

env:
CONSOLE_OUTPUT: XTerm
BUNDLE_WITH: maintenance

jobs:
deploy:
generate:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.1"
ruby-version: "3.2"
bundler-cache: true

- name: Installing packages
run: sudo apt-get install wget

- name: Prepare GitHub Pages
run: bundle exec bake github:pages:prepare --directory docs

- name: Generate documentation
timeout-minutes: 5
run: bundle exec bake utopia:project:static --force no

- name: Deploy GitHub Pages
run: bundle exec bake github:pages:commit --directory docs
- name: Upload documentation artifact
uses: actions/upload-pages-artifact@v1
with:
path: docs

deploy:
runs-on: ubuntu-latest

environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}

needs: generate
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
2 changes: 1 addition & 1 deletion .github/workflows/test-external.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
- macos

ruby:
- "2.7"
- "3.0"
- "3.1"
- "3.2"

steps:
- uses: actions/checkout@v3
Expand Down
18 changes: 3 additions & 15 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,20 @@ env:

jobs:
test:
name: ${{matrix.ruby}} on ${{matrix.os}} ${{matrix.gemfile}}
name: ${{matrix.ruby}} on ${{matrix.os}}
runs-on: ${{matrix.os}}-latest
continue-on-error: ${{matrix.experimental}}

env:
BUNDLER_GEMFILE: ${{matrix.gemfile}}

strategy:
matrix:
os:
- ubuntu
# - macos
- macos

ruby:
- "2.7"
- "3.0"
- "3.1"

gemfile:
- gems/rack-v1.rb
- gems/rack-v2.rb
- gems/rack-v3.rb
- gems/rack-head.rb
- "3.2"

experimental: [false]

Expand All @@ -46,9 +37,6 @@ jobs:
- os: ubuntu
ruby: head
experimental: true
- os: macos
ruby: "3.1"
experimental: false

steps:
- uses: actions/checkout@v3
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
.tags
/.bundle/
/pkg/
/gems.locked
/.covered.db
/external

/.bundle/
/.yardoc
Expand Down
4 changes: 4 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Mitsutaka Mimura <takkanm@gmail.com>
Kyle Tam <kyle_tam1@hotmail.com>
Claudiu Garba <claudiu.garba@gmail.com>

3 changes: 0 additions & 3 deletions .rspec

This file was deleted.

4 changes: 3 additions & 1 deletion bake/falcon/supervisor.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

# Restart the application server via the supervisor.
# Released under the MIT License.
# Copyright, 2020, by Samuel Williams.

def restart
require_relative '../../lib/falcon/command/supervisor'

Expand Down
3 changes: 3 additions & 0 deletions examples/beer/falcon.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env falcon-host
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2019-2020, by Samuel Williams.

load :rack, :self_signed_tls, :supervisor

rack 'beer.localhost', :self_signed_tls
Expand Down
3 changes: 3 additions & 0 deletions examples/benchmark/bake.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2018-2021, by Samuel Williams.

require 'etc'

require 'async'
Expand Down
3 changes: 3 additions & 0 deletions examples/benchmark/falcon.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env -S ./bin/falcon virtual
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2019-2020, by Samuel Williams.

load :rack, :self_signed_tls, :supervisor

rack 'benchmark.local', :self_signed_tls
27 changes: 27 additions & 0 deletions examples/bug/config.ru
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
class HelloWorld
JSON_TYPE = "application/json".freeze
PLAINTEXT_TYPE = "text/plain".freeze

def respond(type, body)
[200, { "Content-Type" => type }, [body]]
end

def call(env)
case env["PATH_INFO"]
when "/json"
# Test type 1: JSON serialization
return respond JSON_TYPE,
Oj.dump({ message: "Hello, World!" }, { mode: :strict })
when "/plaintext"
# Test type 6: Plaintext
return respond PLAINTEXT_TYPE, "Hello, World!"
end

[200, {}, []]
end
end

# run HelloWorld.new

run do
end
13 changes: 13 additions & 0 deletions examples/bug/falcon.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env -S falcon host
# frozen_string_literal: true

load :rack, :supervisor

hostname = File.basename(__dir__)
rack hostname do
endpoint Async::HTTP::Endpoint.parse("http://0.0.0.0:8080").with(
protocol: Async::HTTP::Protocol::HTTP11
)
end

supervisor
3 changes: 3 additions & 0 deletions examples/call/gems.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2021-2022, by Samuel Williams.

source "https://rubygems.org"

gem "falcon"
Expand Down
3 changes: 3 additions & 0 deletions examples/google/falcon.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env falcon-host
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2020, by Samuel Williams.

load :proxy, :self_signed_tls, :supervisor

supervisor
Expand Down
3 changes: 3 additions & 0 deletions examples/hello/falcon.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env falcon-host
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2019-2020, by Samuel Williams.

load :rack, :self_signed_tls, :supervisor

supervisor
Expand Down
3 changes: 3 additions & 0 deletions examples/hello/preload.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2020, by Samuel Williams.

if GC.respond_to?(:compact)
Console.logger.warn(self, "Compacting the mainframe...")
GC.compact
Expand Down
3 changes: 3 additions & 0 deletions examples/memory/allocations.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2019-2022, by Samuel Williams.

class Allocations
def initialize(app)
@app = app
Expand Down
5 changes: 4 additions & 1 deletion examples/push/client.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2019-2020, by Samuel Williams.

require 'async'
require 'async/http/endpoint'
require 'async/http/client'
Expand All @@ -26,4 +29,4 @@
client.close
end

puts "Done"
puts "Done"
3 changes: 3 additions & 0 deletions examples/server/standalone.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2020-2022, by Samuel Williams.

require 'async'
require 'async/http/endpoint'
require 'async/websocket/adapters/rack'
Expand Down
5 changes: 5 additions & 0 deletions examples/streaming/gems.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2022, by Samuel Williams.

source "https://rubygems.org"

gem 'trenni', '~> 3.14'
Expand Down
3 changes: 3 additions & 0 deletions examples/trailer/falcon.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env falcon-host
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2020-2021, by Samuel Williams.

load :rack, :self_signed_tls, :supervisor

rack 'trailer.localhost', :self_signed_tls
Expand Down
3 changes: 3 additions & 0 deletions examples/websockets/gems.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2022, by Samuel Williams.

source "https://rubygems.org"

gem "falcon", path: "../../"
Expand Down
Loading

0 comments on commit 0d24166

Please sign in to comment.