Skip to content

Commit

Permalink
Merge pull request #16 from wiktor-k/wiktor/misc-fixes
Browse files Browse the repository at this point in the history
Add adjustments from other projects and release 0.4.1
  • Loading branch information
wiktor-k authored Jul 22, 2024
2 parents e18e2c2 + 55fe2da commit 1502e5c
Show file tree
Hide file tree
Showing 9 changed files with 381 additions and 24 deletions.
6 changes: 6 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Ubuntu packages
UBUNTU_PACKAGES=
# Windows packages
WINDOWS_PACKAGES=
# macOS packages
MACOS_PACKAGES=
23 changes: 8 additions & 15 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cargo install --locked just
- run: sudo apt-get install -y codespell
- name: Check spelling
run: just spelling
uses: codespell-project/actions-codespell@v2

formatting:
name: Check formatting
Expand All @@ -34,7 +32,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- run: cargo install --locked just
- uses: taiki-e/install-action@just
- run: rustup install nightly
- run: rustup component add rustfmt --toolchain nightly
- name: Check formatting
Expand All @@ -51,24 +49,18 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- run: cargo install --locked just
- uses: taiki-e/install-action@just
- run: just install-packages
- name: Run unit tests
run: just tests

deps:
name: Check dependencies
strategy:
matrix:
include:
- os: ubuntu-latest
- os: macos-latest
- os: windows-latest
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cargo install --locked just cargo-deny
- name: Run dependencies check
run: just dependencies
uses: EmbarkStudios/cargo-deny-action@v1

lints:
name: Clippy lints
Expand All @@ -81,6 +73,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- run: cargo install --locked just
- uses: taiki-e/install-action@just
- run: just install-packages
- name: Check for lints
run: just lints
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/target
/Cargo.lock
21 changes: 20 additions & 1 deletion .justfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#!/usr/bin/env -S just --working-directory . --justfile
# Load project-specific properties from the `.env` file

set dotenv-load := true

# Since this is a first recipe it's being run by default.
# Faster checks need to be executed first for better UX. For example

# codespell is very fast. cargo fmt does not need to download crates etc.

# Perform all checks
check: spelling formatting docs lints dependencies tests

# Checks common spelling mistakes
Expand Down Expand Up @@ -31,6 +36,16 @@ tests:
docs:
cargo doc --no-deps

# Installs packages required to build
[linux]
install-packages:
sudo apt-get install --assume-yes --no-install-recommends $UBUNTU_PACKAGES

[macos]
[windows]
install-packages:
echo no-op

# Checks for commit messages
check-commits REFS='main..':
#!/usr/bin/env bash
Expand All @@ -57,13 +72,17 @@ check-commits REFS='main..':
# Fixes common issues. Files need to be git add'ed
fix:
#!/usr/bin/env bash
set -euo pipefail
if ! git diff-files --quiet ; then
echo "Working tree has changes. Please stage them: git add ."
exit 1
fi
codespell --write-changes
just --unstable --fmt
# try to fix rustc issues
cargo fix --allow-staged
# try to fix clippy issues
cargo clippy --fix --allow-staged

# fmt must be last as clippy's changes may break formatting
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

## v0.4.1

- Expose `TestError` and make a couple of doc improvements. Thanks to @ijackson for implementing this change ([#14](https://github.com/wiktor-k/testresult/pull/14)).

## v0.4.0

Expand Down
Loading

0 comments on commit 1502e5c

Please sign in to comment.