Compare commits
1 commit
| Author | SHA1 | Date | |
|---|---|---|---|
| 2ec9d356b2 |
3 changed files with 3 additions and 94 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -2,5 +2,4 @@ bin/
|
||||||
obj/
|
obj/
|
||||||
/packages/
|
/packages/
|
||||||
riderModule.iml
|
riderModule.iml
|
||||||
/_ReSharper.Caches/
|
/_ReSharper.Caches/
|
||||||
/.contest
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
# Stitch-a-ton Contest Submission
|
# Stitch-a-ton Contest Submission
|
||||||
|
|
||||||
|
Repository moved to: https://github.com/denniskematian/GigATon
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
This project is build using .NET 9, with SixLabors.ImageSharp as the only external library.
|
This project is build using .NET 9, with SixLabors.ImageSharp as the only external library.
|
||||||
|
|
|
||||||
92
mise.toml
92
mise.toml
|
|
@ -1,92 +0,0 @@
|
||||||
# Quick Guide
|
|
||||||
# - install mise
|
|
||||||
# - download the asset and extract them to ASSET_PATH_RO
|
|
||||||
# - mise trust mise.toml
|
|
||||||
# - mise run verify-asset
|
|
||||||
# - require hashdeep
|
|
||||||
# `hashdeep` package in debian
|
|
||||||
# or `md5deep` package in fedora
|
|
||||||
# or uncomment `tools."http:hashdeep"` below in windows
|
|
||||||
# - mise run serve
|
|
||||||
# - mise run arrange
|
|
||||||
# - mise run action
|
|
||||||
# - mise run assert
|
|
||||||
# - mise run bench
|
|
||||||
|
|
||||||
[env]
|
|
||||||
ASSET_PATH_RO = "{{ [xdg_cache_home, 'stitch-a-ton', 'asset'] | join_path }}"
|
|
||||||
CONTEST_HOST = "http://localhost:7007"
|
|
||||||
CONTEST_API = "/api/image/generate"
|
|
||||||
CONTEST_OUTPUT = "{{ [cwd, '.contest'] | join_path }}"
|
|
||||||
DOTNET_ENVIRONMENT = "Production"
|
|
||||||
ANSWER_COMMIT_HASH = "89a07b40bf0414212c96945671a012035d375a25"
|
|
||||||
|
|
||||||
[tools]
|
|
||||||
dotnet = "9"
|
|
||||||
xh = "latest"
|
|
||||||
uv = "latest"
|
|
||||||
k6 = "latest"
|
|
||||||
|
|
||||||
# uncomment these if you're on windows
|
|
||||||
#[tools."http:hashdeep"]
|
|
||||||
#version = "4.4"
|
|
||||||
|
|
||||||
#[tools."http:hashdeep".platforms]
|
|
||||||
#windows-x64 = {url = "https://github.com/jessek/hashdeep/releases/download/v4.4/md5deep-4.4.zip"}
|
|
||||||
|
|
||||||
[tasks.setup]
|
|
||||||
run = '''
|
|
||||||
{% if env.CONTEST_OUTPUT is not exists %}
|
|
||||||
mkdir .contest
|
|
||||||
{% endif %}
|
|
||||||
'''
|
|
||||||
|
|
||||||
[tasks.verify-asset]
|
|
||||||
dir = "{{ env.ASSET_PATH_RO }}"
|
|
||||||
run = '''
|
|
||||||
xh get https://null.formulatrix.dev/Contest/stitch-a-ton-answer/raw/commit/{{ env.ANSWER_COMMIT_HASH }}/asset.txt -o ../asset.txt
|
|
||||||
hashdeep -arbvk ../asset.txt .
|
|
||||||
'''
|
|
||||||
|
|
||||||
[tasks.arrange]
|
|
||||||
depends = ['setup']
|
|
||||||
dir = "{{ env.CONTEST_OUTPUT }}"
|
|
||||||
outputs = ['answer.json', 'action.py', 'assert.py', 'bench.js', 'fuzzy.json']
|
|
||||||
run = '''
|
|
||||||
xh get https://null.formulatrix.dev/Contest/stitch-a-ton-answer/raw/commit/{{ env.ANSWER_COMMIT_HASH }}/answer.json -o answer.json
|
|
||||||
xh get https://null.formulatrix.dev/Contest/stitch-a-ton-answer/raw/commit/{{ env.ANSWER_COMMIT_HASH }}/action.py -o action.py
|
|
||||||
xh get https://null.formulatrix.dev/Contest/stitch-a-ton-answer/raw/commit/{{ env.ANSWER_COMMIT_HASH }}/assert.py -o assert.py
|
|
||||||
xh get https://null.formulatrix.dev/Contest/stitch-a-ton-answer/raw/commit/{{ env.ANSWER_COMMIT_HASH }}/bench.js -o bench.js
|
|
||||||
xh get https://null.formulatrix.dev/Contest/stitch-a-ton-answer/raw/commit/{{ env.ANSWER_COMMIT_HASH }}/fuzzy.json -o fuzzy.json
|
|
||||||
'''
|
|
||||||
|
|
||||||
[tasks.serve]
|
|
||||||
run = "dotnet run -c Release --no-launch-profile --urls {{env.CONTEST_HOST}} --project App"
|
|
||||||
|
|
||||||
[tasks.quick]
|
|
||||||
depends = ['arrange']
|
|
||||||
dir = "{{ env.CONTEST_OUTPUT }}"
|
|
||||||
run = '''
|
|
||||||
xh post {{env.CONTEST_HOST}}{{env.CONTEST_ENDPOINT}} canvas_rect=A1:H12 crop_offset:=[0,0] crop_size:=[1,1] output_scale:=0.25 -o quick.png
|
|
||||||
'''
|
|
||||||
|
|
||||||
[tasks.action]
|
|
||||||
depends = ['arrange']
|
|
||||||
dir = "{{ env.CONTEST_OUTPUT }}"
|
|
||||||
run = '''
|
|
||||||
uv run --no-config --script {{ [env.CONTEST_OUTPUT, 'action.py'] | join_path }}
|
|
||||||
'''
|
|
||||||
|
|
||||||
[tasks.assert]
|
|
||||||
depends = ['arrange']
|
|
||||||
dir = "{{ env.CONTEST_OUTPUT }}"
|
|
||||||
run = '''
|
|
||||||
uvx --no-config --with-requirements assert.py pytest assert.py
|
|
||||||
'''
|
|
||||||
|
|
||||||
[tasks.bench]
|
|
||||||
depends = ['arrange']
|
|
||||||
dir = "{{ env.CONTEST_OUTPUT }}"
|
|
||||||
run = '''
|
|
||||||
k6 run -e TARGET_URL="{{ env.CONTEST_HOST }}{{ env.CONTEST_API }}" bench.js
|
|
||||||
'''
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue