Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
NicholasLYang committed Jun 7, 2024
1 parent 66ca577 commit 2dd3a22
Show file tree
Hide file tree
Showing 52 changed files with 9,802 additions and 1 deletion.
1 change: 0 additions & 1 deletion crates/update-informer
Submodule update-informer deleted from de93b1
5 changes: 5 additions & 0 deletions crates/update-informer/.codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
coverage:
status:
project:
default:
target: 75%
18 changes: 18 additions & 0 deletions crates/update-informer/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2

[*.json]
indent_size = 2
1 change: 1 addition & 0 deletions crates/update-informer/.github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
open_collective: update-informer
17 changes: 17 additions & 0 deletions crates/update-informer/.github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!--
Thank you for your pull request. Please provide a description above and review
the requirements below.
Bug fixes and new features should include tests.
-->

<!-- _Please make sure to review and check all of these items:_ -->

#### ✔ Checklist:

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [ ] Commit messages have been written in [Conventional Commits](https://www.conventionalcommits.org) format;
- [ ] Tests for the changes have been added (for bug fixes / features).

<!-- _NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open._ -->
3 changes: 3 additions & 0 deletions crates/update-informer/.github/actions-rs/grcov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
llvm: true
output-type: lcov
output-file: ./lcov.info
13 changes: 13 additions & 0 deletions crates/update-informer/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 10

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 10
89 changes: 89 additions & 0 deletions crates/update-informer/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: CI
on:
push:
branches: [main]
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
check-all:
runs-on: ubuntu-latest
strategy:
matrix:
registry:
- crates
- github
- npm
- pypi
http_client:
- ureq
- reqwest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2.7.3
- run: cargo check --no-default-features --features ${{ matrix.registry }},${{ matrix.http_client }}
- run: cargo fmt --all --check
- run: cargo clippy --no-default-features --features ${{ matrix.registry }},${{ matrix.http_client }} -- -D warnings
- run: cargo build --release --no-default-features --features ${{ matrix.registry }},${{ matrix.http_client }}

test-coverage:
runs-on: ubuntu-latest
strategy:
matrix:
all_registries: ["crates,github,npm,pypi"]
http_client:
- ureq
- reqwest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
# https://github.com/dtolnay/rust-toolchain/issues/29
- run: rustup override set nightly
- name: Set grcov version
run: echo "GRCOV_VERSION=$(cargo search --limit 1 grcov | head -n1 | cut -d '"' -f2)" >> $GITHUB_ENV
- run: cargo install --version $GRCOV_VERSION grcov
- name: Clean coverage
run: |
rm -f target/debug/deps/*.gcda
rm -f target/debug/deps/*.gcno
- uses: Swatinem/rust-cache@v2.7.3
with:
key: ${{ env.GRCOV_VERSION }}
- run: cargo test --no-fail-fast --no-default-features --features ${{ matrix.all_registries }},${{ matrix.http_client }}
env:
CARGO_INCREMENTAL: "0"
RUSTFLAGS: |
-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off
RUSTDOCFLAGS: |
-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off
- uses: actions-rs/grcov@v0.1
- uses: codecov/codecov-action@v4
with:
file: ./lcov.info

cargo-sort:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2.7.3
- run: cargo install cargo-sort
- run: cargo-sort --check

links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: lycheeverse/lychee-action@v1.9.3
with:
args: . --verbose --exclude "pkg_name|your_own_registry"
fail: true

style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dprint/check@v2.2
23 changes: 23 additions & 0 deletions crates/update-informer/.github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Linters
on: pull_request

jobs:
misspell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: reviewdog/action-misspell@v1
with:
locale: "US"

prlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: CondeNast/conventional-pull-request-action@v0.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
ignoreCommits: "true"
27 changes: 27 additions & 0 deletions crates/update-informer/.github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release
on:
push:
tags:
- "*.*.*"

env:
CARGO_TERM_COLOR: always

jobs:
release-crate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build and publish to crates.io
run: |
cargo login ${{ secrets.CRATES_TOKEN }}
cargo publish
- name: Publish release
uses: softprops/action-gh-release@v2
with:
draft: true
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21 changes: 21 additions & 0 deletions crates/update-informer/.github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Close stale issues and PRs"
on:
schedule:
- cron: "30 1 * * *"

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
days-before-stale: 14
days-before-close: 5
stale-issue-label: "stale"
stale-pr-label: "stale"
exempt-issue-labels: "good first issue,help wanted,bug"
exempt-pr-labels: "dependencies,bug"
stale-issue-message: "This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days."
stale-pr-message: "This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days."
close-issue-message: "This issue was closed because it has been stalled for 5 days with no activity."
close-pr-message: "This PR was closed because it has been stalled for 5 days with no activity."
2 changes: 2 additions & 0 deletions crates/update-informer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target
Cargo.lock
Loading

0 comments on commit 2dd3a22

Please sign in to comment.