Skip to content
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
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Bug Report
description: File a bug report
labels: ['bug']
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: "1.2.3"
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
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Feature request
description: Suggest a new feature
labels: ['feature']
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
---
39 changes: 39 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Lint

on:
push:
branches:
- main
pull_request:
workflow_call:

permissions:
contents: read

jobs:
lint:
name: Format and Clippy
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Rust (stable)
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: clippy, rustfmt

- name: Cache cargo
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

- name: Format check
run: cargo fmt --all --check

- name: Clippy
run: cargo clippy --workspace --all-targets --all-features -- -D warnings


66 changes: 66 additions & 0 deletions .github/workflows/publish-core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Publish simplicityhl-core

on:
push:
tags:
- 'simplicityhl-core-v*'
workflow_dispatch: {}
release:
types: [published]

jobs:
lint:
name: Lint (reusable)
uses: ./.github/workflows/lint.yml

tests:
name: Tests (reusable)
uses: ./.github/workflows/tests.yml

publish:
name: Publish simplicityhl-core to crates.io
needs: [lint, tests]
runs-on: ubuntu-latest
environment: release
concurrency:
group: publish-core-${{ github.ref }}
cancel-in-progress: false
permissions:
id-token: write
contents: read

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Rust (stable)
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable

- name: Verify tag matches crate version
shell: bash
run: |
TAG="${GITHUB_REF##*/}"
VERSION_TAG="${TAG#simplicityhl-core-v}"
CRATE_VERSION=$(cargo metadata --no-deps --format-version=1 | jq -r '.packages[] | select(.name=="simplicityhl-core").version')
echo "Tag version: $VERSION_TAG"
echo "Crate version: $CRATE_VERSION"
if [ "$VERSION_TAG" != "$CRATE_VERSION" ]; then
echo "Tag version ($VERSION_TAG) does not match crate version ($CRATE_VERSION)"
exit 1
fi

- name: Check package
run: cargo package -p simplicityhl-core

- name: Authenticate with crates.io
id: auth
uses: rust-lang/crates-io-auth-action@v1

- name: Publish
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
run: cargo publish -p simplicityhl-core


42 changes: 42 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Tests

on:
push:
branches:
- main
pull_request:
workflow_call:

permissions:
contents: read

jobs:
test:
name: Build and test (matrix)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain: ["1.90.0", "stable"]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Rust ${{ matrix.toolchain }}
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}

- name: Cache cargo
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

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

- name: Test
run: cargo test --workspace --all-features --no-fail-fast --verbose


12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Build output
/target/

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

# Debugging data
logs.md
tmp_vendor
Loading