Skip to content

Commit

Permalink
Add github templates and workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Systemcluster committed Nov 16, 2023
1 parent 0a557c6 commit c63f154
Show file tree
Hide file tree
Showing 8 changed files with 225 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: Systemcluster
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Bug report
about: Create a report about a non-working or broken feature
title: ''
labels: bug
assignees: Systemcluster

---

**Bug description**
A description of the issue or the error message if one appeared.

**Reproduction steps**
Steps to reproduce the behavior.

**Additional context**
Any other context about the bug report if available.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: Systemcluster

---

**Idea description**
A description of what you would like to see or be able to do.

**Considered alternatives**
A description of alternative solutions or features you've considered if available.

**Additional context**
Any other context about the feature request if available.
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: Question
about: Ask a question about support or unclear features
title: ''
labels: question
assignees: Systemcluster

---
8 changes: 8 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
**Change description**
A description of the changes this pull request introduces.

**Related issues**
Bug reports or feature requests related to this pull request if available.

**Additional context**
Any other context about the pull request if available.
55 changes: 55 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Publish

on:
workflow_run:
branches:
- main
workflows:
- Tests & Checks
types:
completed
workflow_dispatch:

permissions:
contents: write
checks: write
statuses: write

jobs:

publish:

name: Publish
runs-on: ${{ matrix.os }}
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}

strategy:
matrix:
os:
- ubuntu-latest
toolchain:
- stable

steps:
- name: Checkout source
uses: actions/checkout@v4
with:
submodules: recursive
show-progress: false

- name: Set up Rust toolchain
uses: Systemcluster/actions@setup-rust-v0
with:
channel: ${{ matrix.toolchain }}
cache-key-job: true

- name: Run tests
run: cargo test --workspace --all-features

- name: Publish
uses: Systemcluster/actions@release-crates-v0
if: github.ref == 'refs/heads/main' && github.repository_owner == 'Systemcluster'
with:
crates-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
dry-run: ${{ !secrets.CARGO_REGISTRY_TOKEN }}
tag-crate: editpe
118 changes: 118 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: Tests & Checks

on:
pull_request:
paths-ignore:
- ".github/**"
- "**/*.md"
push:
paths-ignore:
- ".github/**"
- "**/*.md"
workflow_dispatch:

permissions:
contents: write
pull-requests: write
checks: write
statuses: write

jobs:

checks:

name: Checks
runs-on: ${{ matrix.os }}

strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
toolchain:
- stable

steps:
- name: Checkout source
uses: actions/checkout@v4
with:
submodules: recursive
show-progress: false

- name: Set up Rust toolchain
uses: Systemcluster/actions@setup-rust-v0
with:
channel: ${{ matrix.toolchain }}
components: clippy
cache-key-job: true

- name: Check build
run: cargo check --workspace --all-features

- name: Check clippy
run: cargo clippy --workspace --all-features

tests:

name: Tests
runs-on: ${{ matrix.os }}

strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
toolchain:
- stable
- beta

steps:
- name: Checkout source
uses: actions/checkout@v4
with:
submodules: recursive
show-progress: false

- name: Set up Rust toolchain
uses: Systemcluster/actions@setup-rust-v0
with:
channel: ${{ matrix.toolchain }}
cache-key-job: true

- name: Run tests
run: cargo test --workspace --all-features

formatting:

name: Formatting
runs-on: ${{ matrix.os }}

if: github.event_name == 'pull_request'

strategy:
matrix:
os:
- ubuntu-latest
toolchain:
- nightly

steps:
- name: Checkout source
uses: actions/checkout@v4
with:
submodules: recursive
show-progress: false

- name: Set up Rust toolchain
uses: Systemcluster/actions@setup-rust-v0
with:
channel: ${{ matrix.toolchain }}
components: rustfmt
cache-key-job: true

- name: Check formatting
uses: mbrobbel/rustfmt-check@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![Crates.io](https://img.shields.io/crates/v/editpe)](https://crates.io/crates/editpe)
[![Docs.rs](https://img.shields.io/docsrs/editpe)](https://docs.rs/editpe)
[![Tests & Checks](https://img.shields.io/github/actions/workflow/status/Systemcluster/editpe/tests.yml?label=tests%20%26%20checks)](https://github.com/Systemcluster/editpe/actions/workflows/tests.yml)

Resource **edit**or for **p**ortable **e**xecutables.

Expand Down

0 comments on commit c63f154

Please sign in to comment.