From 71d52e031b40f72617205e0cc76c5f42e8fff3b0 Mon Sep 17 00:00:00 2001 From: Serial <69764315+Serial-ATA@users.noreply.github.com> Date: Sat, 5 Oct 2024 17:57:51 -0400 Subject: [PATCH] chore: add workflow to verify template builds --- .github/workflows/verify-template.yml | 33 +++++++++++++++++++++++++++ src/main.rs | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/verify-template.yml diff --git a/.github/workflows/verify-template.yml b/.github/workflows/verify-template.yml new file mode 100644 index 0000000..b5632a7 --- /dev/null +++ b/.github/workflows/verify-template.yml @@ -0,0 +1,33 @@ +name: Verify Template +on: + workflow_dispatch: + pull_request: + push: + branches: [ 'main' ] + paths-ignore: + - "**.md" + +jobs: + build: + runs-on: ubuntu-latest + env: + PROJECT_NAME: blueprint-template + steps: + - uses: actions/checkout@v4 + - uses: JohnPeel/cargo-generate-action@main + with: + name: ${{ env.PROJECT_NAME }} + arguments: > + --define gh-username="webb-tools" + --define project-description="An example blueprint" + --define project-homepage="https://webb.tools" + --define flakes=true + --define docker=true + --define base-image="rustlang/rust:nightly" + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + - run: | + cp -r $PROJECT_NAME ${{ runner.temp }}/ + cd ${{ runner.temp }}/$PROJECT_NAME + cargo check diff --git a/src/main.rs b/src/main.rs index ad732be..f8539c0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ use color_eyre::Result; use gadget_sdk as sdk; -use {{project-name}} as blueprint; +use {{project-name | snake_case}} as blueprint; use sdk::{ config::ContextConfig, events_watcher::substrate::SubstrateEventWatcher, events_watcher::tangle::TangleEventsWatcher, tangle_subxt::*,