Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
ck = "check --workspace --all-targets --all-features --locked"
lint = "clippy --workspace --all-targets --all-features"
codecov = "llvm-cov nextest --workspace --ignore-filename-regex tasks"
benchmark = "run -p pacquet_benchmark --release --"
111 changes: 111 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Benchmark

on:
workflow_dispatch:
pull_request:
types: [opened, synchronize]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
benchmark:
strategy:
matrix:
os: [ubuntu-latest] # `macos-latest` is too unstable to be useful for benchmark, the variance is always huge.
name: Run benchmark on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Main Branch
uses: actions/checkout@v3
with:
ref: main # Checkout main first because the cache is warm

- name: Install Rust Toolchain
uses: ./.github/actions/rustup
with:
shared-key: benchmark

- name: Compile
run: cargo build --release -p pacquet_benchmark

- name: Sleep for CPU cooldown
shell: bash
run: sleep 15s

- name: Run Bench on Main Branch
run: cargo benchmark --save-baseline main

- name: Checkout PR Branch
uses: actions/checkout@v3
with:
clean: false
ref: ${{ github.event.pull_request.head.sha }}

- name: Compile
run: cargo build --release -p pacquet_benchmark

- name: Sleep for CPU cooldown
shell: bash
run: sleep 15s

- name: Run Bench on PR Branch
run: cargo benchmark --save-baseline pr

- name: Upload benchmark results
uses: actions/upload-artifact@v3
with:
name: benchmark-results-${{ matrix.os }}
path: ./target/criterion

benchmark-compare:
runs-on: ubuntu-latest
name: Compare Benchmarks
needs:
- benchmark

steps:
- name: Install critcmp
uses: taiki-e/install-action@v2
with:
tool: critcmp

- name: Linux | Download PR benchmark results
uses: actions/download-artifact@v3
with:
name: benchmark-results-ubuntu-latest
path: ./target/criterion

- name: Linux | Compare benchmark results
shell: bash
run: |
echo "## Benchmark Results" >> summary.md
echo "### Linux" >> summary.md
echo "\`\`\`" >> summary.md
critcmp main pr >> summary.md
echo "\`\`\`" >> summary.md
echo "" >> summary.md

- name: Linux | Cleanup benchmark results
run: rm -rf ./target/criterion

- name: Find Comment
# Check if the event is not triggered by a fork
if: github.event.pull_request.head.repo.full_name == github.repository
uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Benchmark Results

- name: Create or update comment
# Check if the event is not triggered by a fork
if: github.event.pull_request.head.repo.full_name == github.repository
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ github.event.pull_request.number }}
edit-mode: replace
comment-id: ${{ steps.fc.outputs.comment-id }}
body-file: summary.md
50 changes: 50 additions & 0 deletions .github/workflows/cargo-unused.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Run `cargo-unused-features` for finding out unused features
# NOTE: this is broken for now, see https://github.com/TimonPost/cargo-unused-features/pull/10

name: Cargo Unused Features

on:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
bloat:
name: Cargo Unused Features
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Rust Toolchain
uses: ./.github/actions/rustup

- name: Install cargo-unused-features
uses: taiki-e/install-action@v2
with:
tool: cargo-unused-features

- name: Run
run: unused-features analyze

check-dependencies:
name: Check Unused Dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
src:
- 'Cargo.lock'

- name: Install cargo-udeps
if: steps.filter.outputs.src == 'true'
uses: taiki-e/install-action@cargo-udeps

- if: steps.filter.outputs.src == 'true'
run: cargo udeps
20 changes: 0 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,6 @@ jobs:
with:
files: .

check-dependencies:
name: Check Unused Dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
src:
- 'Cargo.lock'

- name: Install cargo-udeps
if: steps.filter.outputs.src == 'true'
uses: taiki-e/install-action@cargo-udeps

- if: steps.filter.outputs.src == 'true'
run: cargo udeps

deny:
name: Cargo Deny
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target
.pacquet
node_modules
.npmrc
5 changes: 5 additions & 0 deletions .taplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include = ["Cargo.toml", "crates/*/*.toml", "tasks/*/*.toml"]

[formatting]
align_entries = true
column_width = 120
Loading