Skip to content

Commit

Permalink
chore(ci): codspeed and check changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
jeertmans committed Sep 29, 2024
1 parent 05a1857 commit 513077c
Show file tree
Hide file tree
Showing 7 changed files with 545 additions and 534 deletions.
74 changes: 10 additions & 64 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,15 @@
name: Check Changelog

on:
pull_request:
workflow_dispatch:

name: CHANGELOG check

types: [assigned, opened, synchronize, reopened, labeled, unlabeled]
branches:
- main
jobs:
changelog_check:
runs-on: ubuntu-latest
check-changelog:
name: Check Changelog Action
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Check if changelog was updated
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
src:
- 'CHANGELOG.md'
- name: Find Comment
uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: github-actions[bot]
body-includes: CHANGELOG
- if: steps.changes.outputs.src == 'false' && steps.fc.outputs.comment-id == ''
name: Create comment
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
Please summarize your changes in [CHANGELOG.md](CHANGELOG.md).
See [Keep A Changelog](https://keepachangelog.com/en/1.0.0/) for more details.
reactions: rocket
edit-mode: replace
- if: steps.changes.outputs.src == 'false' && steps.fc.outputs.comment-id != ''
name: Update comment
uses: peter-evans/create-or-update-comment@v2
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
body: |
Please summarize your changes in [CHANGELOG.md](CHANGELOG.md).
See [Keep A Changelog](https://keepachangelog.com/en/1.0.0/) for more details.
reactions: rocket
edit-mode: replace
- if: steps.changes.outputs.src == 'true' && steps.fc.outputs.comment-id == ''
name: Create comment
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
Thank you for updating [CHANGELOG.md](CHANGELOG.md)! Always feel free to edit it.
See [Keep A Changelog](https://keepachangelog.com/en/1.0.0/) for more details.
reactions: hooray
edit-mode: replace
- if: steps.changes.outputs.src == 'true' && steps.fc.outputs.comment-id != ''
name: Update comment
uses: peter-evans/create-or-update-comment@v2
- uses: tarides/changelog-check-action@v2
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
body: |
Thank you for updating [CHANGELOG.md](CHANGELOG.md)! Always feel free to edit it.
See [Keep A Changelog](https://keepachangelog.com/en/1.0.0/) for more details.
reactions: hooray
edit-mode: replace
- if: steps.changes.outputs.src == 'false'
run: echo "Please summarize your changes in [CHANGELOG.md](CHANGELOG.md)." && exit 1
- if: steps.changes.outputs.src == 'true'
run: exit 0
changelog: CHANGELOG.md
45 changes: 10 additions & 35 deletions .github/workflows/rustbench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,42 +28,17 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache dependencies
uses: Swatinem/rust-cache@v2

- name: Install Critcmp
uses: baptiste0928/cargo-install@v2
- name: Setup rust toolchain, cache and cargo-codspeed binary
uses: moonrepo/setup-rust@v0
with:
crate: critcmp
version: latest

- name: Run Benchmarks on changes
run: cargo bench --bench bench_main -- --save-baseline changes

- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.base.sha }}
clean: false

- name: Run Benchmarks before changes
run: cargo bench --bench bench_main -- --save-baseline before
channel: stable
cache-target: release
bins: cargo-codspeed

- name: Compare benchmarks
run: |
echo 'results<<EOF' >> $GITHUB_OUTPUT
critcmp before changes >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
id: compare
- name: Build the benchmark target(s)
run: cargo codspeed build

- name: Comment PR with execution number
uses: thollander/actions-comment-pull-request@v2
- name: Run the benchmarks
uses: CodSpeedHQ/action@v3
with:
message: |
Benchmark results:
```
${{ steps.compare.outputs.results }}
```
comment_tag: benchmarks
run: cargo codspeed run
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased](https://github.com/jeertmans/languagetool-rust/compare/v2.1.4...HEAD)

### Chore

- Fixed dependency declaration in README.md. [#118](https://github.com/jeertmans/languagetool-rust/pull/118)
- Fixed some types. [#115](https://github.com/jeertmans/languagetool-rust/pull/115)
- Derive `Hash` on requests types. [#114](https://github.com/jeertmans/languagetool-rust/pull/114)
- Use Codspeed and `check-changelog` actions. [#121](https://github.com/jeertmans/languagetool-rust/pull/121)

## [2.1.4](https://github.com/jeertmans/languagetool-rust/compare/v2.1.3...v2.1.4)

### Fixed
Expand Down
Loading

0 comments on commit 513077c

Please sign in to comment.