Skip to content
Draft
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
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Bug Report
description: File a bug report
labels: ['bug']
assignees:
-
body:
- type: markdown
attributes:
value: Thanks for taking the time to fill out this bug report!
- type: input
id: version
attributes:
label: "Project version"
placeholder: "0.1.2"
validations:
required: true
- type: textarea
id: what-happened
attributes:
label: What happened?
description: A brief description of what happened and what you expected to happen
validations:
required: true
- type: textarea
id: reproduction-steps
attributes:
label: "Minimal reproduction steps"
description: "The minimal steps needed to reproduce the bug"
validations:
required: true
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Feature request
description: Suggest a new feature
labels: ['feature']
assignees:
-
body:
- type: textarea
id: feature-description
attributes:
label: "Describe the feature"
description: "A description of what you would like to see in the project"
validations:
required: true
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/other-issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
name: Other issue
about: Other kind of issue
---
22 changes: 22 additions & 0 deletions .github/actions/setup-smplx/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: setup-smplx

inputs:
commit-sha:
description: "Commit in repository to use"
required: false
default: "master"
owner-repo:
description: "Owner repo on Github to use"
required: false
default: "BlockstreamResearch/smplx"

runs:
using: composite
steps:
- name: Install smplx-cli via simplexup
shell: bash
run: |
set -euo pipefail
REVISION="${{ inputs.commit-sha}}"
OWNER_REPO="${{ inputs.owner-repo }}"
bash "$GITHUB_WORKSPACE/.github/scripts/setup-smplx" "${REVISION}" "${OWNER_REPO}"
68 changes: 68 additions & 0 deletions .github/scripts/setup-smplx
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/usr/bin/env bash

set -euo pipefail

say() {
printf "setup-smplx: %s\n" "$1"
}

err() {
say "$1" >&2
exit 1
}

main() {
# Parse and validate arguments
COMMIT_SHA="${1:-}"
OWNER_REPO="${2:-}"
FETCH_REF="${COMMIT_SHA:-master}"
FILE_PATH="simplexup/install"

if [ "$#" -lt 2 ]; then
err "Usage: setup-smplx <revision> <owner_repo>"
fi

if [ -z "$OWNER_REPO" ]; then
err "no OWNER_REPO variable set"
fi

# Download and execute the initial install script
RAW_URL="https://raw.githubusercontent.com/${OWNER_REPO}/${FETCH_REF}/${FILE_PATH}"
say "Fetching ${FILE_PATH} from ${RAW_URL}"

curl -fsSL --retry 5 --retry-all-errors --retry-delay 2 "${RAW_URL}" | bash

# Download the simplexup executable
FILE_PATH="simplexup/simplexup"
RAW_URL="https://raw.githubusercontent.com/${OWNER_REPO}/${FETCH_REF}/${FILE_PATH}"

BASE_DIR="${XDG_CONFIG_HOME:-$HOME}"
SIMPLEX_DIR="${SIMPLEX_DIR:-$BASE_DIR/.simplex}"
SIMPLEX_BIN_DIR="$SIMPLEX_DIR/bin"
BIN_PATH="$SIMPLEX_BIN_DIR/simplexup"

# Ensure bin directory exists and download simplexup into it
mkdir -p "$SIMPLEX_BIN_DIR"
say "Fetching ${FILE_PATH} from ${RAW_URL}"

curl -fsSL --retry 5 --retry-all-errors --retry-delay 2 "${RAW_URL}" -o "$BIN_PATH"
chmod +x "$BIN_PATH"

# Execute simplexup, using a specific commit if provided (and not master's default release)
if [ "$FETCH_REF" != "master" ]; then
say "Using simplexup and simplex from commit: ${FETCH_REF}"
"$BIN_PATH" --commit "${FETCH_REF}"
else
say "Using simplexup from master branch and installing latest simplex"
"$BIN_PATH"
fi

# Add the Simplex binary directory to GitHub Actions PATH
echo "$SIMPLEX_BIN_DIR" >> "$GITHUB_PATH"

# Verify installation
say "Verifying simplex installation..."
"${SIMPLEX_BIN_DIR}/simplex" --version
}

main "$@"
61 changes: 61 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Smplx-tests

on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master
- dev

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full

jobs:
simplex-tests:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
strategy:
fail-fast: false
matrix:
toolchain: [ "1.91.0" ]

steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
submodules: true

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.toolchain }}

- name: Use Rust cache
uses: Swatinem/rust-cache@v2

- name: Install simplex-cli
uses: ./.github/actions/setup-smplx

- name: Generate contract artifacts
shell: bash
run: |
simplex build

- name: Build
run: |
cargo build --workspace --all-features --verbose

- name: Test
run: |
simplex test --nocapture
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Build output
target/

# Simplex output
src/artifacts

# IDE/editors (optional but common minimal)
**/.DS_Store
.idea/
.vscode/
.cache
.env
Loading
Loading