Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve/fix CI #279

Merged
merged 7 commits into from
Aug 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 19 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
rust: [stable, nightly]
rust:
- 1.70.0 # MSRV
- stable
- nightly
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -35,21 +38,29 @@ jobs:
# This is useful for debugging problems when the expected build artifacts
# (like shell completions and man pages) aren't generated.
- name: Show build.rs stderr
if: matrix.os == 'windows-latest'
shell: bash
run: |
set +x
mapfile -d '' -t STDERR_FILES < <(find "./target/debug" -name stderr -print0 | grep -z bandwhich)
for FILE in "${STDERR_FILES[@]}"; do
echo "===== $FILE ===== "
# it's probably okay to assume no spaces?
STDERR_FILES=$(find "./target/debug" -name stderr | grep bandwhich)
for FILE in $STDERR_FILES; do
echo "::group::$FILE"
cat "$FILE"
echo "====="
echo "::endgroup::"
done
set -x

- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings

- name: Install npcap on Windows
if: matrix.os == 'windows-latest'
env:
NPCAP_OEM_URL: ${{ secrets.NPCAP_OEM_URL }}
run: |
Invoke-WebRequest -Uri "$env:NPCAP_OEM_URL" -OutFile "$env:TEMP/npcap-oem.exe"
# for this ridiculous `&` syntax alone, I'd rather use COBOL than Powershell
# see https://stackoverflow.com/a/1674950/5637701
& "$env:TEMP/npcap-oem.exe" /S

- name: Run tests
run: cargo test --verbose

Expand Down