Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: website publish #447

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/lua.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -euo pipefail

LUA_VERSION="5.4.6"
LUA_VERSION="5.4.7"
# https://www.lua.org/ftp/#
pushd /tmp
curl -L -R -O http://www.lua.org/ftp/lua-$LUA_VERSION.tar.gz
Expand Down
11 changes: 5 additions & 6 deletions .github/odin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

set -euo pipefail

VERSION=dev-2024-01
FILE_NAME=odin-ubuntu-amd64-$VERSION.zip
VERSION=dev-2024-11
FILE_NAME=odin-linux-amd64-$VERSION.zip
sudo apt-get install -y aria2
mkdir /tmp/odin
mkdir /tmp/odin || true
cd /tmp/odin
aria2c -c -o $FILE_NAME https://github.com/odin-lang/Odin/releases/download/$VERSION/$FILE_NAME
if test -d ubuntu_artifacts; then sudo rm -rf ubuntu_artifacts; fi
unzip -o $FILE_NAME
if test -d ubuntu_artifacts; then ODIN_BIN_PATH=$PWD/ubuntu_artifacts/odin; else ODIN_BIN_PATH=$PWD/odin; fi
sudo chmod +x $ODIN_BIN_PATH
tar -xvf dist.tar.gz
ODIN_BIN_PATH=$(pwd)/$(find */odin)
sudo ln -sf $ODIN_BIN_PATH /usr/bin/odin
odin version
6 changes: 4 additions & 2 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ jobs:
node-version: 18.x
- uses: pnpm/action-setup@v2
with:
version: 8
version: 9
- uses: actions/download-artifact@v3
with:
# Artifact name
Expand All @@ -347,8 +347,10 @@ jobs:
pushd website
pnpm i
pnpm content
pnpm build
pnpm archive-dist
- name: Site Publish
if: github.ref == 'refs/heads/main'
env:
VERCEL_PUBLISH_TOKEN: ${{ secrets.VERCEL_PUBLISH_TOKEN }}
run: vercel website --prod --confirm -t $VERCEL_PUBLISH_TOKEN || echo 'ignore errors'
run: vercel website --prod --yes -t $VERCEL_PUBLISH_TOKEN || echo 'ignore errors'
4 changes: 2 additions & 2 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ jobs:
node-version: 18.x
- uses: pnpm/action-setup@v2
with:
version: 8
- run: pnpm --version
version: 9
- run: vercel --version
- name: Build
run: |
cd website
pnpm i
pnpm build
pnpm archive-dist
92 changes: 46 additions & 46 deletions bench/algorithm/binarytrees/1.odin
Original file line number Diff line number Diff line change
Expand Up @@ -3,63 +3,63 @@
package main

import "core:fmt"
import "core:strconv"
import "core:os"
import "core:math"
import "core:mem"
import "core:os"
import "core:strconv"

MIN_DEPTH :: 4
main :: proc() {
n := strconv.parse_int(os.args[1]) or_else 10
max_depth := math.max(MIN_DEPTH+2,n)
{
stretch_depth := max_depth + 1
stretch_tree := makeTree(stretch_depth)
defer { delete_tree(stretch_tree) }
fmt.printf("stretch tree of depth %d\t check: %d\n", stretch_depth, check(stretch_tree) );
}
long_lived_tree := makeTree(max_depth)
defer delete_tree(long_lived_tree)
depth:int= MIN_DEPTH;
for ;depth <= max_depth; depth += 2 {
iterations := 1 << u8(max_depth - depth + MIN_DEPTH)
sum: u64 = 0
for _ in 0..<iterations {
tree := makeTree(depth)
defer { delete_tree(tree) }
sum += u64(check(tree))
}
fmt.printf("%d\t trees of depth %d\t check: %d\n", iterations, depth, sum )
}
#no_bounds_check n := strconv.parse_int(os.args[1]) or_else 10
max_depth := math.max(MIN_DEPTH + 2, n)
{
stretch_depth := max_depth + 1
stretch_tree := makeTree(stretch_depth)
defer {delete_tree(stretch_tree)}
fmt.printf("stretch tree of depth %d\t check: %d\n", stretch_depth, check(stretch_tree))
}
long_lived_tree := makeTree(max_depth)
defer delete_tree(long_lived_tree)
depth: int = MIN_DEPTH
for ; depth <= max_depth; depth += 2 {
iterations := 1 << u8(max_depth - depth + MIN_DEPTH)
sum: u64 = 0
for _ in 0 ..< iterations {
tree := makeTree(depth)
defer {delete_tree(tree)}
sum += u64(check(tree))
}
fmt.printf("%d\t trees of depth %d\t check: %d\n", iterations, depth, sum)
}

fmt.printf("long lived tree of depth %d\t check: %d\n", max_depth, check(long_lived_tree))
fmt.printf("long lived tree of depth %d\t check: %d\n", max_depth, check(long_lived_tree))
}

Node :: struct {
left,right:^Node,
left, right: ^Node,
}

makeTree::proc(depth:int)->^Node {
node := new(Node)
if node == nil {
fmt.println("alloc error")
return node
}
if depth > 0 {
node.left = makeTree(depth-1)
node.right = makeTree(depth-1)
}
return node
makeTree :: proc(depth: int) -> ^Node {
node := new(Node)
if node == nil {
fmt.println("alloc error")
return node
}
if depth > 0 {
node.left = makeTree(depth - 1)
node.right = makeTree(depth - 1)
}
return node
}
delete_tree::proc(t:^Node){
if t.left != nil {delete_tree(t.left)}
if t.right != nil {delete_tree(t.right)}
free(t)
delete_tree :: proc(t: ^Node) {
if t.left != nil {delete_tree(t.left)}
if t.right != nil {delete_tree(t.right)}
free(t)
}
check::proc(tree:^Node)->int {
sum : int = 1
if tree == nil { return 0 }
sum += check(tree.left)
sum += check(tree.right)
return sum
check :: proc(tree: ^Node) -> int {
sum: int = 1
if tree == nil {return 0}
sum += check(tree.left)
sum += check(tree.right)
return sum
}
6 changes: 3 additions & 3 deletions bench/algorithm/helloworld/1.odin
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package main

import "base:runtime"
import "core:fmt"
import "core:runtime"

main :: proc() {
args := runtime.args__
name := len(args) > 1 ? args[1] : ""
args := runtime.args__
name := len(args) > 1 ? args[1] : ""
fmt.printf("Hello world %s!\n", name)
}
Loading
Loading