Skip to content

Commit 92ac809

Browse files
authored
Merge pull request #4 from wiktor-k/wiktor/update-deps
Update dependencies
2 parents 2551a04 + fb509d7 commit 92ac809

File tree

8 files changed

+304
-223
lines changed

8 files changed

+304
-223
lines changed

.env

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Ubuntu packages
2+
UBUNTU_PACKAGES=libpcsclite-dev
3+
# Windows packages
4+
WINDOWS_PACKAGES=
5+
# macOS packages
6+
MACOS_PACKAGES=

.github/workflows/rust.yml

+9-21
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,21 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- uses: actions/checkout@v4
21-
- run: cargo install --locked just
22-
- run: sudo apt-get install -y codespell
2321
- name: Check spelling
24-
run: just spelling
22+
uses: codespell-project/actions-codespell@v2
2523

2624
formatting:
2725
name: Check formatting
2826
strategy:
2927
matrix:
3028
include:
3129
- os: ubuntu-latest
32-
libs: libpcsclite-dev
3330
- os: macos-latest
3431
- os: windows-latest
3532
runs-on: ${{ matrix.os }}
3633
steps:
3734
- uses: actions/checkout@v4
38-
- run: cargo install --locked just
35+
- uses: taiki-e/install-action@just
3936
- run: rustup install nightly
4037
- run: rustup component add rustfmt --toolchain nightly
4138
- name: Check formatting
@@ -47,30 +44,23 @@ jobs:
4744
matrix:
4845
include:
4946
- os: ubuntu-latest
50-
libs: libpcsclite-dev
5147
- os: macos-latest
5248
- os: windows-latest
5349
runs-on: ${{ matrix.os }}
5450
steps:
5551
- uses: actions/checkout@v4
56-
- run: sudo apt-get update && sudo apt-get install -y ${{ matrix.libs }}
57-
if: ${{ matrix.libs }}
58-
- run: cargo install --locked just
52+
- uses: taiki-e/install-action@just
53+
- run: just install-packages
5954
- name: Run unit tests
6055
run: just tests
6156

6257
deps:
6358
name: Check dependencies
64-
strategy:
65-
matrix:
66-
include:
67-
- os: ubuntu-latest
68-
- os: macos-latest
69-
- os: windows-latest
70-
runs-on: ${{ matrix.os }}
59+
runs-on: ubuntu-latest
7160
steps:
7261
- uses: actions/checkout@v4
73-
- run: cargo install --locked just cargo-deny
62+
- uses: taiki-e/install-action@just
63+
- uses: taiki-e/install-action@cargo-deny
7464
- name: Run dependencies check
7565
run: just dependencies
7666

@@ -80,14 +70,12 @@ jobs:
8070
matrix:
8171
include:
8272
- os: ubuntu-latest
83-
libs: libpcsclite-dev
8473
- os: macos-latest
8574
- os: windows-latest
8675
runs-on: ${{ matrix.os }}
8776
steps:
8877
- uses: actions/checkout@v4
89-
- run: sudo apt-get update && sudo apt-get install -y ${{ matrix.libs }}
90-
if: ${{ matrix.libs }}
91-
- run: cargo install --locked just
78+
- uses: taiki-e/install-action@just
79+
- run: just install-packages
9280
- name: Check for lints
9381
run: just lints

.justfile

+20-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
#!/usr/bin/env -S just --working-directory . --justfile
2+
# Load project-specific properties from the `.env` file
3+
4+
set dotenv-load := true
5+
26
# Since this is a first recipe it's being run by default.
37
# Faster checks need to be executed first for better UX. For example
4-
58
# codespell is very fast. cargo fmt does not need to download crates etc.
9+
10+
# Perform all checks
611
check: spelling formatting docs lints dependencies tests
712

813
# Checks common spelling mistakes
@@ -31,6 +36,16 @@ tests:
3136
docs:
3237
cargo doc --no-deps
3338

39+
# Installs packages required to build
40+
[linux]
41+
install-packages:
42+
sudo apt-get install --assume-yes --no-install-recommends $UBUNTU_PACKAGES
43+
44+
[macos]
45+
[windows]
46+
install-packages:
47+
echo no-op
48+
3449
# Checks for commit messages
3550
check-commits REFS='main..':
3651
#!/usr/bin/env bash
@@ -57,13 +72,17 @@ check-commits REFS='main..':
5772
# Fixes common issues. Files need to be git add'ed
5873
fix:
5974
#!/usr/bin/env bash
75+
set -euo pipefail
6076
if ! git diff-files --quiet ; then
6177
echo "Working tree has changes. Please stage them: git add ."
6278
exit 1
6379
fi
6480

6581
codespell --write-changes
6682
just --unstable --fmt
83+
# try to fix rustc issues
84+
cargo fix --allow-staged
85+
# try to fix clippy issues
6786
cargo clippy --fix --allow-staged
6887

6988
# fmt must be last as clippy's changes may break formatting

0 commit comments

Comments
 (0)