Skip to content

Commit

Permalink
👷 Run package tests in a temporary directory
Browse files Browse the repository at this point in the history
  • Loading branch information
bash committed Sep 27, 2024
1 parent 0306133 commit e9ff834
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,8 @@ jobs:
test_package:
name: Test Package
runs-on: ubuntu-latest
strategy:
matrix:
package: [terminal-colorsaurus, termtheme]
steps:
- uses: actions/checkout@v4
- name: Package
run: cargo package -p ${{matrix.package}}
- name: Test Package
run: (cd target/package/${{matrix.package}}-*/ && cargo test)
- run: sudo apt-get install just
- run: just test-package terminal-colorsaurus
- run: just test-package termtheme
10 changes: 10 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
default:
just --list

test-package name *args:
#!/usr/bin/env bash
set -euxo pipefail
CARGO_TARGET_DIR=$(mktemp -d); export CARGO_TARGET_DIR
trap 'rm -rf "$CARGO_TARGET_DIR"' EXIT
cargo package -p "{{name}}" {{args}}
(cd $CARGO_TARGET_DIR/package/{{name}}-*/ && cargo test)

0 comments on commit e9ff834

Please sign in to comment.