Compare commits

..

7 Commits

Author SHA1 Message Date
alex c49c56a86e twiddle 2025-12-02 09:36:09 +00:00
alex 02fae316d9 twiddle 2025-12-02 09:31:09 +00:00
alex 4f51fc2d47 twiddle 2025-12-02 09:28:23 +00:00
alex 6cca5f422b oops 2025-12-02 08:55:02 +00:00
alex 60cb4246f9 try to simplify 2025-12-02 08:37:29 +00:00
alex 2b291e4463 add more parens 2025-12-01 23:39:19 +00:00
alex 72e3e1ac66 deploy on push to main 2025-12-01 23:25:43 +00:00
2 changed files with 32 additions and 33 deletions
+26 -2
View File
@@ -1,16 +1,27 @@
name: Strudel tests
name: Strudel test + warm deploy
on: [push, pull_request]
jobs:
build:
test-and-warm-deploy:
runs-on: docker
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
strategy:
matrix:
node-version: [20]
steps:
- uses: actions/checkout@v4
- name: Debug Forgejo context
run: |
echo "hmm"
echo "EVENT_NAME = ${{ forgejo.event_name }}"
echo "REF = ${{ forgejo.ref }}"
echo "REF_NAME = ${{ forgejo.ref_name }}"
echo "EVENT_NAME = $FORGEJO_EVENT_NAME"
echo "REF = $FORGEJO_REF"
echo "REF_NAME = $FORGEJO_REF_NAME"
- name: apt install ztd
run: apt update && apt install -y zstd
- uses: pnpm/action-setup@v4
@@ -24,3 +35,16 @@ jobs:
- run: pnpm run format-check
- run: pnpm run lint
- run: pnpm test
- name: Build
if: ${{ forgejo.event_name == 'push' && forgejo.ref == 'refs/heads/main' }}
run: pnpm build
- name: Warm deploy
# automatically deploy to warm on pushes to main
if: ${{ forgejo.event_name == 'push' && forgejo.ref == 'refs/heads/main' }}
run: |
eval $(ssh-agent -s)
echo "$SSH_PRIVATE_KEY" | ssh-add -
apt update && apt install -y rsync
mkdir ~/.ssh
ssh-keyscan matrix.toplap.org > ~/.ssh/known_hosts
rsync -atv --delete --delete-after --progress ./website/dist/ strudel@matrix.toplap.org:/home/strudel/deploy/warm.strudel.cc
+6 -31
View File
@@ -1456,39 +1456,14 @@ export function cat(...pats) {
* @return {Pattern}
* @example
* arrange(
* 4, "<c a f e>(3,8)",
* 2, "<g a>(5,8)"
* [4, "<c a f e>(3,8)"],
* [2, "<g a>(5,8)"]
* ).note()
*/
export function arrange(...input) {
if (Array.isArray(input[0])) {
return arrange_deprecated(...input);
}
if (input.length % 2 !== 0) {
throw new Error('Arrange needs a length paramter for each pattern (length, pattern, length, pattern)');
}
let sects = [];
let total = 0;
for (let i = 0; i < input.length; i += 2) {
let cycles = input.at(i);
total += cycles;
let pattern = input.at(i + 1);
sects.push([cycles, pattern.fast(cycles)]);
}
return stepcat(...sects).slow(total);
}
// handle old array syntax ex:
// arrange(
// [4, "<c a f e>(3,8)"],
// [2, "<g a>(5,8)"]
// ).note()
//
function arrange_deprecated(...sects) {
const total = sects.reduce((sum, [cycles]) => sum + cycles, 0);
sects = sects.map(([cycles, pattern]) => [cycles, pattern.fast(cycles)]);
return stepcat(...sects).slow(total);
export function arrange(...sections) {
const total = sections.reduce((sum, [cycles]) => sum + cycles, 0);
sections = sections.map(([cycles, section]) => [cycles, section.fast(cycles)]);
return stepcat(...sections).slow(total);
}
/**