mirror of
https://github.com/imjasonh/krust
synced 2026-07-18 23:16:03 +00:00
Add tests to pre-commit hooks and simplify CI matrix
- Add cargo test and e2e tests to pre-commit hooks - Temporarily disable macOS CI to focus on Linux - Ensure all tests pass locally before committing
This commit is contained in:
parent
40dbb7053e
commit
5d254c7eca
3 changed files with 15 additions and 14 deletions
14
.github/workflows/ci.yml
vendored
14
.github/workflows/ci.yml
vendored
|
|
@ -16,7 +16,7 @@ jobs:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macos-latest]
|
os: [ubuntu-latest]
|
||||||
rust: [stable, beta]
|
rust: [stable, beta]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
@ -30,18 +30,6 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y musl-tools
|
sudo apt-get install -y musl-tools
|
||||||
- name: Install cross-compilation tools (macOS)
|
|
||||||
if: matrix.os == 'macos-latest'
|
|
||||||
run: |
|
|
||||||
# Install musl-cross from the correct tap
|
|
||||||
brew install messense/macos-cross-toolchains/x86_64-unknown-linux-musl
|
|
||||||
# Set up cargo config for cross-compilation
|
|
||||||
mkdir -p ~/.cargo
|
|
||||||
echo '[target.x86_64-unknown-linux-musl]' >> ~/.cargo/config.toml
|
|
||||||
echo 'linker = "x86_64-unknown-linux-musl-gcc"' >> ~/.cargo/config.toml
|
|
||||||
- name: Set up Docker (macOS)
|
|
||||||
if: matrix.os == 'macos-latest'
|
|
||||||
uses: douglascamata/setup-docker-macos-action@v1-alpha
|
|
||||||
- name: Cache cargo registry
|
- name: Cache cargo registry
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,20 @@ repos:
|
||||||
types: [rust]
|
types: [rust]
|
||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
|
|
||||||
|
- id: cargo-test
|
||||||
|
name: cargo test
|
||||||
|
entry: cargo test
|
||||||
|
language: system
|
||||||
|
types: [rust]
|
||||||
|
pass_filenames: false
|
||||||
|
|
||||||
|
- id: cargo-test-e2e
|
||||||
|
name: cargo e2e tests
|
||||||
|
entry: cargo test --test '*'
|
||||||
|
language: system
|
||||||
|
types: [rust]
|
||||||
|
pass_filenames: false
|
||||||
|
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v4.5.0
|
rev: v4.5.0
|
||||||
hooks:
|
hooks:
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,6 @@ fn test_verbose_logging() -> Result<()> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(not(ci), ignore)] // Run in CI, but allow skipping locally
|
|
||||||
fn test_full_build_and_run_workflow() -> Result<()> {
|
fn test_full_build_and_run_workflow() -> Result<()> {
|
||||||
// This test requires Docker
|
// This test requires Docker
|
||||||
let docker_check = StdCommand::new("docker").arg("version").output();
|
let docker_check = StdCommand::new("docker").arg("version").output();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue