feat(heap-dump): add --redact, --compress, and --open flags #50
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Pull Request Validation | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| - master | |
| permissions: | |
| contents: read | |
| jobs: | |
| validate: | |
| name: Lint & Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: ">=1.23.5" | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - name: Set up Node.js for markdownlint | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "24" | |
| - name: Download JStall minimal JAR for go:embed | |
| run: | | |
| mkdir -p dist | |
| curl -fsSL -o dist/jstall-minimal.jar https://github.com/parttimenerd/jstall/releases/latest/download/jstall-minimal.jar | |
| - name: Download hprof-redact binaries for go:embed | |
| run: python3 .github/workflows/build.py --deps-only | |
| - name: Install Go dependencies | |
| run: go mod tidy -e || true | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: latest | |
| - name: Run govulncheck | |
| run: | | |
| go install golang.org/x/vuln/cmd/govulncheck@latest | |
| govulncheck -json . 2>/dev/null | python3 -c " | |
| import sys, json | |
| decoder = json.JSONDecoder() | |
| data = sys.stdin.read().strip() | |
| pos = 0 | |
| while pos < len(data): | |
| obj, idx = decoder.raw_decode(data, pos) | |
| pos = idx | |
| while pos < len(data) and data[pos] in ' \t\n\r': | |
| pos += 1 | |
| if not isinstance(obj, dict): | |
| continue | |
| finding = obj.get('finding') | |
| if not finding: | |
| continue | |
| osv_id = finding.get('osv', '') | |
| traces = finding.get('trace', []) | |
| mod = traces[0].get('module', '') if traces else '' | |
| ver = traces[0].get('version', '') if traces else '' | |
| fixed = finding.get('fixed_version', '') | |
| summary = f'{mod} {ver} is vulnerable ({osv_id}); fixed in {fixed}' if fixed else osv_id | |
| loc = '' | |
| for frame in reversed(traces): | |
| fpos = frame.get('position', {}) | |
| fname = fpos.get('filename', '') | |
| line_no = fpos.get('line', '') | |
| if fname: | |
| loc = f'file={fname},line={line_no},' | |
| break | |
| print(f'::warning {loc}title=govulncheck [{osv_id}]::{summary}') | |
| " || true | |
| - name: Lint Go code | |
| run: ./scripts/lint-go.sh ci | |
| - name: Run Go tests | |
| run: go test -v -race ./... | |
| - name: Check Python test suite | |
| id: check-python | |
| run: | | |
| if [ -f "test/requirements.txt" ] && [ -f "test/setup.sh" ]; then | |
| echo "python_tests_exist=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "python_tests_exist=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Setup Python environment | |
| if: steps.check-python.outputs.python_tests_exist == 'true' | |
| run: | | |
| cd test | |
| python -m venv venv | |
| source venv/bin/activate | |
| python -m pip install --upgrade pip | |
| python -m pip install -r requirements.txt | |
| - name: Validate Python code quality | |
| if: steps.check-python.outputs.python_tests_exist == 'true' | |
| run: ./scripts/lint-python.sh ci | |
| - name: Lint Markdown files | |
| run: ./scripts/lint-markdown.sh ci | |
| build: | |
| name: Build (${{ matrix.os }}) | |
| needs: validate | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: ">=1.23.5" | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - name: Download JStall minimal JAR for go:embed | |
| shell: bash | |
| run: | | |
| mkdir -p dist | |
| curl -fsSL -o dist/jstall-minimal.jar https://github.com/parttimenerd/jstall/releases/latest/download/jstall-minimal.jar | |
| - name: Download hprof-redact binaries for go:embed | |
| shell: bash | |
| run: python3 .github/workflows/build.py --deps-only | |
| - name: Install Go dependencies | |
| run: go mod tidy -e || true | |
| - name: Run Go tests | |
| shell: bash | |
| run: go test -race ./... | |
| - name: Build plugin | |
| shell: bash | |
| run: python3 .github/workflows/build.py | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cf-cli-java-plugin-${{ matrix.os }} | |
| path: | | |
| dist/* | |
| !dist/jstall-minimal.jar | |
| !dist/hprof-redact-* |