Skip to content

Commit

Permalink
INIT COMMIT
Browse files Browse the repository at this point in the history
Signed-off-by: Gaukas Wang <[email protected]>
  • Loading branch information
gaukas committed Feb 21, 2024
0 parents commit 55099b4
Show file tree
Hide file tree
Showing 547 changed files with 247,735 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Global code owners including the original authors who
# are actively taking a role in maintaining this project.
* @gaukas @erikziyunchi
63 changes: 63 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: "Release"

# Build only on new tags
on:
push:
tags:
- '*'

env:
CGO_ENABLED: 0

jobs:
watm_tinygo_v0_artifacts:
name: "watm: build ${{ matrix.watm.name }}.v0.tinygo.wasm with TinyGo"
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
watm: [
{ name: "plain", scheduler: "none", gc: "conservative", tags: "purego" },
{ name: "reverse", scheduler: "none", gc: "conservative", tags: "purego" },
{ name: "utls", scheduler: "asyncify", gc: "conservative", tags: "purego" }
]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.21.x"
- uses: acifani/setup-tinygo@v2
with:
tinygo-version: '0.30.0'
- name: Build WATM Artifacts
run: tinygo build -o ../../../${{ matrix.watm.name }}.v0.tinygo.wasm
-target=wasi -no-debug -scheduler=${{ matrix.watm.scheduler }}
-gc=${{ matrix.watm.gc }} -tags=${{ matrix.watm.tags }}
./${{ matrix.watm.name }}/
working-directory: ./tinygo/v0/examples/
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.watm.name }}.v0.tinygo
path: ${{ matrix.watm.name }}.v0.tinygo.wasm
retention-days: 1

release:
needs:
- watm_tinygo_v0_artifacts
name: "Release WATM Examples for ${{ github.ref_name }}"
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: release-${{ github.ref_name }} # all artifacts
- name: List Artifacts
run: ls -R release-${{ github.ref_name }}
- name: Release
uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/')
with:
name: ${{ github.ref_name }}
files: |
release-${{ github.ref_name }}/**/*.wasm
59 changes: 59 additions & 0 deletions .github/workflows/watm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: "watm"

on:
push:
branches: [ "master" ]
paths:
- '!tinygo/snippets/**' # ignore changes to snippets since they are not impacting the module
- '!**.md' # ignore changes to markdown files since they are not part of the code
- '!**/LICENSE*'
pull_request:
branches: [ "master" ]
paths:
- '!tinygo/snippets/**' # ignore changes to snippets since they are not impacting the module
- '!**.md' # ignore changes to markdown files since they are not part of the code
- '!**/LICENSE*'

env:
CGO_ENABLED: 0

jobs:
watm_build_and_test:
name: "go${{ matrix.go }} test"
runs-on: ubuntu-latest
strategy:
matrix:
go: [ "1.21.x", "1.22.x" ] # we support the latest 2 stable versions of Go
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- run: go version
- name: Build and Test
run: |
go build -v ./...
go test -v ./...
watm_build_tinygo_v0_examples:
name: "build ${{ matrix.examples }}.v0.tinygo.wasm w/ tinygo ${{ matrix.tinygo }} (go${{ matrix.go }})"
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
tinygo: [ "0.30.0" ] # latest tinygo version ONLY (1)
go: [ "1.20.x", "1.21.x" ] # latest 2 stable versions of Go. TODO: bump to 1.22.x once tinygo support added.
examples: [ "plain", "reverse", "utls" ] # Add examples here per ones under tinygo/v0/examples
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- uses: acifani/setup-tinygo@v2
with:
tinygo-version: ${{ matrix.tinygo }}
- name: Build
run: |
mkdir -p tmp
tinygo build -o tmp/${{ matrix.examples }}.wasm -target=wasi -tags=purego ./${{ matrix.examples }}/
working-directory: ./tinygo/v0/examples/
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace file
go.work

# Generated by Cargo
# will have compiled files and executables
debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

# Ignore WebAssembly
*.wasm
Loading

0 comments on commit 55099b4

Please sign in to comment.