Skip to content

Commit

Permalink
secure mode tests in repotests
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <[email protected]>
  • Loading branch information
prabhu committed Jan 29, 2025
1 parent eeac2a2 commit cd88404
Showing 1 changed file with 98 additions and 1 deletion.
99 changes: 98 additions & 1 deletion .github/workflows/repotests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
cli-tests:
strategy:
fail-fast: true
matrix:
Expand Down Expand Up @@ -642,3 +642,100 @@ jobs:
with:
name: bomresults
path: bomresults

secure-mode-tests:
strategy:
fail-fast: true
matrix:
node-version: ['23.x']
os: ['ubuntu-24.04', 'ubuntu-24.04-arm', 'windows-latest', 'macos-15']
runs-on: ${{ matrix.os }}
env:
CDXGEN_SECURE_MODE: true
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '23'
- uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Trim CI agent
if: matrix.os == 'ubuntu-24.04' || matrix.os == 'ubuntu-24.04-arm'
run: |
chmod +x contrib/free_disk_space.sh
./contrib/free_disk_space.sh
- uses: sbt/setup-sbt@v1
- name: Install bazelisk - linux
if: matrix.os == 'ubuntu-24.04'
run: |
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-linux-amd64"
sudo mv bazelisk-linux-amd64 /usr/local/bin/bazel
chmod +x /usr/local/bin/bazel
- name: Install bazelisk - linux arm
if: matrix.os == 'ubuntu-24.04-arm'
run: |
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-linux-arm64"
sudo mv bazelisk-linux-arm64 /usr/local/bin/bazel
chmod +x /usr/local/bin/bazel
- name: Install bazelisk - mac
if: matrix.os == 'macos-15'
run: |
brew install bazelisk
- name: Install bazelisk - windows
if: matrix.os == 'windows-latest'
run: choco install -y bazel
- name: npm install, build and test
run: |
corepack enable
corepack pnpm install --package-import-method copy
corepack pnpm test
mkdir -p repotests
mkdir -p bomresults
mkdir -p denoresults
env:
CI: true
CDXGEN_TEMP_DIR: ${{ runner.temp }}/cdxgen-repotests
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: true
- name: pip install custom-json-diff
run: |
pip install custom-json-diff
- uses: actions/checkout@v4
with:
repository: 'hoolicorp/java-sec-code'
path: 'repotests/java-sec-code'
- name: setup sdkman
run: |
curl -s "https://get.sdkman.io" | bash
if: runner.os != 'Windows'
- name: setup rbenv
run: |
git clone https://github.com/rbenv/rbenv.git --depth=1 ~/.rbenv
echo 'export PATH="~/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(~/.rbenv/bin/rbenv init - bash)"' >> ~/.bashrc
source ~/.bashrc
mkdir -p "~/.rbenv/plugins"
git clone https://github.com/rbenv/ruby-build.git --depth=1 "~/.rbenv/plugins/ruby-build"
if: runner.os != 'Windows'
- name: repotests java-sec-code
run: |
bin/cdxgen.js -p -t java ${GITHUB_WORKSPACE}/repotests/java-sec-code -o ${GITHUB_WORKSPACE}/bomresults/bom-java-sec-code-1.json --fail-on-error
bin/cdxgen.js -p -t java ${GITHUB_WORKSPACE}/repotests/java-sec-code -o ${GITHUB_WORKSPACE}/bomresults/bom-java-sec-code-2.json --author foo --author bar --standard asvs-4.0.3
bin/cdxgen.js -p -t java ${GITHUB_WORKSPACE}/repotests/java-sec-code -o ${GITHUB_WORKSPACE}/bomresults/bom-java-sec-code-3.json --required-only --fail-on-error
bin/cdxgen.js -p -t java ${GITHUB_WORKSPACE}/repotests/java-sec-code -o ${GITHUB_WORKSPACE}/bomresults/bom-java-sec-code-4.json --filter postgres --filter json
shell: bash
env:
NODE_OPTIONS: "--permission --allow-fs-read=${{ github.workspace }}/* --allow-fs-write=${{ github.workspace }}/* --allow-fs-read=${{ runner.temp }}/* --allow-fs-write=${{ runner.temp }}/* --allow-child-process --trace-warnings"

0 comments on commit cd88404

Please sign in to comment.