From 73ab23f09b0d4ad93a0c60cd544bd3e3dc4975ef Mon Sep 17 00:00:00 2001 From: Max Countryman Date: Thu, 10 Oct 2024 10:35:48 -0700 Subject: [PATCH] github workflows --- .github/FUNDING.yml | 3 ++ .github/ISSUE_TEMPLATE/bug_report.md | 51 ++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 4 ++ .github/dependabot.yml | 12 +++++ .github/workflows/rust.yml | 71 ++++++++++++++++++++++++++++ 5 files changed, 141 insertions(+) create mode 100644 .github/FUNDING.yml create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/rust.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..90fa34b --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,3 @@ +# These are supported funding model platforms + +github: [maxcountryman] diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..ce233e6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,51 @@ +--- +name: 🐛 Bug Report +about: If something isn't working as expected 🤔. +--- + + + +- [ ] I have looked for existing issues (including closed) about this + +## Bug Report + +### Version + + + +### Platform + + + +### Crates + + + +### Description + + diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..e475100 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,4 @@ +contact_links: + - name: 🙏 GitHub Discussions + url: https://github.com/maxcountryman/underway/discussions + about: General support, questions-and-answers, feature requests, etc diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..ad2f84d --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +version: 2 + +updates: + - package-ecosystem: "cargo" + directory: "/" + schedule: + interval: "daily" + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..4c2dc1f --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,71 @@ +name: Rust + +on: + push: + branches: + - main + pull_request: {} + +env: + CARGO_TERM_COLOR: always + +jobs: + check: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - run: | + rustup toolchain install nightly --profile minimal --component rustfmt --component clippy + - uses: Swatinem/rust-cache@v2 + - name: clippy + run: | + cargo clippy --all --all-targets --all-features -- -Dwarnings + - name: rustfmt + run: | + cargo +nightly fmt --all -- --check + + check-docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: | + rustup toolchain install stable --profile minimal + - uses: Swatinem/rust-cache@v2 + - name: cargo doc + env: + RUSTDOCFLAGS: "-D rustdoc::broken-intra-doc-links" + run: | + cargo doc --all-features --no-deps + + test-docs: + needs: check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: | + rustup toolchain install nightly --profile minimal + - uses: Swatinem/rust-cache@v2 + - name: Run doc tests + run: | + cargo test --all-features --doc + + test-lib: + needs: check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: | + rustup toolchain install nightly --profile minimal + cargo install cargo-tarpaulin + - uses: Swatinem/rust-cache@v2 + - name: Run lib tests + run: | + cargo test --workspace --all-features --lib + cargo tarpaulin --workspace --all-features --lib -olcov + - name: Upload coverage data to Codecov + uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: true + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}