diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..9e70c0a --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: Systemcluster diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..86eb96a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -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. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..3e8be6a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -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. diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md new file mode 100644 index 0000000..36549e4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.md @@ -0,0 +1,8 @@ +--- +name: Question +about: Ask a question about support or unclear features +title: '' +labels: question +assignees: Systemcluster + +--- diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..ab7f45f --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -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. diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..4f9b43e --- /dev/null +++ b/.github/workflows/publish.yml @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..f931db3 --- /dev/null +++ b/.github/workflows/tests.yml @@ -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 }} diff --git a/README.md b/README.md index 5376819..bc92d35 100644 --- a/README.md +++ b/README.md @@ -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.