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

Add support for sandboxfs #424

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion .github/actions/linter_tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ runs:
case "$RUNNER_OS" in
Linux)
sudo apt-get update
sudo apt-get -y install libperl-critic-perl perltidy zlib1g-dev
sudo apt-get -y install libperl-critic-perl perltidy zlib1g-dev pkg-config libfuse-dev
;;
macOS)
brew tap macos-fuse-t/homebrew-cask
brew install fuse-t
sed "s/1.0.26/2.6.0/g" /usr/local/lib/pkgconfig/fuse-t.pc | sudo tee /usr/local/lib/pkgconfig/osxfuse.pc
brew install cpm
cpm install -g --no-test --color Perl::Critic Perl::Tidy
brew unlink perl && brew link perl
Expand Down
36 changes: 36 additions & 0 deletions .github/actions/tool_tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
description: Additional args to append to the test invocation
required: false
default: tools
trunk-token:
description: CI debugger api token
required: true

runs:
# TODO(Tyler): See if this can be converted to a js action
Expand All @@ -31,15 +34,48 @@
shell: bash
working-directory: ${{ inputs.path }}

- name: Install packages
run: |
case "$RUNNER_OS" in
Linux)
sudo apt-get update
sudo apt-get -y install libperl-critic-perl perltidy zlib1g-dev pkg-config libfuse-dev
;;
macOS)
brew tap macos-fuse-t/homebrew-cask
brew install fuse-t
sed "s/1.0.26/2.6.0/g" /usr/local/lib/pkgconfig/fuse-t.pc | sudo tee /usr/local/lib/pkgconfig/osxfuse.pc
brew install cpm
cpm install -g --no-test --color Perl::Critic Perl::Tidy
brew unlink perl && brew link perl
;;
esac
shell: bash

- name: Install dependencies
run: npm ci
shell: bash
working-directory: ${{ inputs.path }}

- name: Run plugin tests
if: runner.os == 'Windows'
run: npm test --ci ${{ inputs.append-args }}
shell: bash
working-directory: ${{ inputs.path }}
env:
PLUGINS_TEST_CLI_VERSION: ${{ inputs.cli-version }}
PLUGINS_TEST_CLI_PATH: ${{ inputs.cli-path }}

- name: Run plugin tests
if: runner.os != 'Windows'
uses: trunk-io/breakpoint@v1

Check failure on line 71 in .github/actions/tool_tests/action.yaml

View check run for this annotation

Trunk-Staging.io / Trunk Check

semgrep(yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha.third-party-action-not-pinned-to-commit-sha)

[new] An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.
with:
breakpoint-id: trunk-plugins-linter-tests
shell: bash
working-directory: ${{ inputs.path }}
trunk-token: ${{ inputs.trunk-token }}
org: trunk-staging-org
run: npm test --ci ${{ inputs.append-args }}
env:
PLUGINS_TEST_CLI_VERSION: ${{ inputs.cli-version }}
PLUGINS_TEST_CLI_PATH: ${{ inputs.cli-path }}
2 changes: 2 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ jobs:
append-args:
${{ needs.detect_changes.outputs.all-tools }} ${{
needs.detect_changes.outputs.tools-files }}
trunk-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }}

- name: Tool Tests Latest
# Run tests using Latest with any modified tools (see filters.yaml). Don't run when cancelled.
Expand All @@ -154,6 +155,7 @@ jobs:
uses: ./.github/actions/tool_tests
with:
append-args: ${{ needs.detect_changes.outputs.tools-files }}
trunk-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }}

# Run repo healthcheck tests
repo_tests:
Expand Down
12 changes: 12 additions & 0 deletions tools/sandboxfs/plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 0.1
tools:
definitions:
## Note, depends on libfuse-dev on linux and OSXFUSE on macos
- name: sandboxfs
runtime: rust
package: sandboxfs
known_good_version: 0.2.0
environment:
- name: PATH
list: ["${tool}/bin"]
shims: [sandboxfs]
12 changes: 12 additions & 0 deletions tools/sandboxfs/sandboxfs.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { makeToolTestConfig, toolTest } from "tests";

toolTest({
toolName: "sandboxfs",
toolVersion: "0.2.0",
testConfigs: [
makeToolTestConfig({
command: ["sandboxfs", "--version"],
expectedOut: "sandboxfs 0.2.0",
}),
],
});