Skip to content

feat: first version of listing and deleting plugins with CLI #1293

feat: first version of listing and deleting plugins with CLI

feat: first version of listing and deleting plugins with CLI #1293

Workflow file for this run

name: Hipcheck
# Run on both PRs and pushes to the main branch.
# It may seem redundant to run tests on main, since we disallow pushing directly
# to main and all PRs get tested before merging.
#
# But due to how GitHub Actions isolates caches, we need to run the tests on
# main so that caches are available to new PRs. The caches created when testing
# PR code cannot be re-used outside of testing that PR.
#
# See the GitHub Actions documentation here:
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache
on:
push:
branches: [main]
paths:
- "config/**"
- "hipcheck/**"
- "plugins/**"
- "xtask/**"
- "sdk/rust/**"
- "hipcheck-common/**"
- "hipcheck-macros/**"
- "hipcheck-sdk-macros/**"
pull_request:
branches: [main]
paths:
- "config/**"
- "hipcheck/**"
- "plugins/**"
- "xtask/**"
- "sdk/rust/**"
- "hipcheck-common/**"
- "hipcheck-macros/**"
- "hipcheck-sdk-macros/**"
permissions:
contents: read
env:
RUSTFLAGS: -Dwarnings
CARGO_TERM_COLOR: always
jobs:
test:
strategy:
matrix:
# NOTE: this list of runners is manually synced with the set used by
# `dist` and should be kept up to date. we've purposefully chosen to
# use two different versions of macOS here to achieve ARM and x86
# support (macos-14 is ARM, macos-13 is x86), since alternative runners
# with matching versions aren't all on the free plan for GitHub
# Actions.
os: [ubuntu-20.04, windows-2019, macos-14, macos-13]
name: "Test (${{ matrix.os }})"
runs-on: ${{ matrix.os }}
timeout-minutes: 15
steps:
# Get the repo, get Rust, get `cargo-nextest`, setup caching.
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@nextest
- uses: swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}
# Install the protobuf compiler
- if: runner.os == 'Linux'
run: sudo apt-get install -y protobuf-compiler
- if: runner.os == 'macOS'
run: brew install protobuf
- if: runner.os == 'Windows'
run: choco install protoc
# Print dependency info (useful for debugging)
- name: Dependency Tree
run: cargo tree
# Try building every crate in the workspace.
# Note that this actually runs "cargo check" and doesn't attempt
# to link the resulting artifacts together.
- name: Build
run: cargo build --verbose --workspace
# Test the code.
- name: Test
run: cargo nextest r --verbose --workspace
# Run the linter.
- name: Lint
run: cargo clippy --verbose --workspace
# Run our own checks for licensing and other info.
- name: Check
run: cargo xtask check
# Generate a GitHub API Token for doing Hipcheck runs
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.HIPCHECK_CI_APP_ID }}
private-key: ${{ secrets.HIPCHECK_CI_APP_PRIV_KEY }}
# Run a few variants of Hipcheck
- name: Run with Policy
env:
HC_GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
run: ./target/debug/hc --policy ./config/Hipcheck.kdl check https://github.com/mitre/hipcheck
- name: Run with Local Policy
env:
HC_GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
run: ./target/debug/hc --policy ./config/local.Hipcheck.kdl check https://github.com/mitre/hipcheck
- name: Run with Config
env:
HC_GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
run: ./target/debug/hc --config ./config check https://github.com/mitre/hipcheck