Skip to content

Commit

Permalink
feat: Add actions ✨
Browse files Browse the repository at this point in the history
  • Loading branch information
kdheepak committed Dec 24, 2023
1 parent 456deeb commit af55eac
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build Template
on:
push:
branches:
- main
pull_request:

jobs:
build-simple:
runs-on: ubuntu-latest
env:
PROJECT_NAME: ratatui-github-example
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run cargo generate
uses: cargo-generate/[email protected]
with:
name: ${{ env.PROJECT_NAME }}
template: simple
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cargo check
# we need to move the generated project to a temp folder, away from the template project
# otherwise `cargo` runs would fail
# see https://github.com/rust-lang/cargo/issues/9922
run: |
mv $PROJECT_NAME ${{ runner.temp }}/
cd ${{ runner.temp }}/$PROJECT_NAME
cargo check --tests
build-async:
runs-on: ubuntu-latest
env:
PROJECT_NAME: ratatui-github-example
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run cargo generate
uses: cargo-generate/[email protected]
with:
name: ${{ env.PROJECT_NAME }}
template: async
template_values_file: .github/workflows/template.toml
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cargo check
# we need to move the generated project to a temp folder, away from the template project
# otherwise `cargo` runs would fail
# see https://github.com/rust-lang/cargo/issues/9922
run: |
mv $PROJECT_NAME ${{ runner.temp }}/
cd ${{ runner.temp }}/$PROJECT_NAME
cargo check --tests
7 changes: 7 additions & 0 deletions .github/workflows/template.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[values]
gh-username = "ratatui"
project-description = "Example of ratatui template"
msrv = "nightly"
use_gitserver = false
crossterm_io = "stderr"
use_rustfmt = false

0 comments on commit af55eac

Please sign in to comment.