Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 32 additions & 33 deletions .github/workflows/checks-sealights.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ jobs:

Initialize:
runs-on: ubuntu-latest
env:
SEALIGHTS_LOG_LEVEL: none
outputs:
bsid: ${{ steps.sealights-scan.outputs.bsid }}
steps:
Expand Down Expand Up @@ -101,7 +99,7 @@ jobs:
echo "[Sealights] Configuring SeaLights to scan the pull request branch"
echo "Latest commit sha: ${LATEST_COMMIT_SHA}"
echo "PR Number: ${PULL_REQUEST_NUMBER}"
./slcli config create-pr-bsid --app ec-cli --target-branch "main" --pull-request-number ${PULL_REQUEST_NUMBER} --latest-commit ${LATEST_COMMIT_SHA} --repository-url https://github.com/enterprise-contract/ec-cli.git
./slcli config create-pr-bsid --app ec-cli-test --target-branch "main" --pull-request-number ${PULL_REQUEST_NUMBER} --latest-commit ${LATEST_COMMIT_SHA} --repository-url https://github.com/enterprise-contract/ec-cli.git
env:
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number }}
LATEST_COMMIT_SHA: ${{github.event.pull_request.head.sha}}
Expand All @@ -110,7 +108,7 @@ jobs:
if: env.on-event == 'push'
run: |
echo "[Sealights] Configuring SeaLights to scan the main branch after pull request was closed"
./slcli config create-bsid --app ec-cli --branch main --build ${LATEST_COMMIT_SHA}
./slcli config create-bsid --app ec-cli-test --branch main --build ${LATEST_COMMIT_SHA}
env:
LATEST_COMMIT_SHA: ${{ github.sha }}

Expand All @@ -120,6 +118,7 @@ jobs:
echo "[Sealights] Running the SeaLights scan"
./slcli scan --bsid buildSessionId.txt --path-to-scanner ./slgoagent --workspacepath ./ --scm git --scmBaseUrl https://github.com/enterprise-contract/ec-cli.git --scmVersion “0” --scmProvider github
echo bsid=$(< buildSessionId.txt) | tee -a "$GITHUB_OUTPUT"

- name: clean all SeaLights secret stuff
run: |
echo "[Sealights] Cleaning up after SeaLights run"
Expand Down Expand Up @@ -153,32 +152,32 @@ jobs:
- name: Test
run: make test

Acceptance:
runs-on: ubuntu-latest
needs: [Initialize, Test]
env:
BSID: ${{ needs.Initialize.outputs.bsid }}
SEALIGHTS_LOG_LEVEL: none
SEALIGHTS_CONNECTION_TIMEOUT: 120s
steps:
- name: Restore workspace
uses: actions/cache@v4
with:
path: ${{ github.workspace }}
key: workspace-${{ github.run_id }}

- name: Update podman
run: |
"${GITHUB_WORKSPACE}/hack/ubuntu-podman-update.sh"
- name: Create a test session
run: ./slcli test start-stage --bsid=$BSID --testStage "Acceptance Tests"

- name: Acceptance test
run: make acceptance-sealights

- name: Upload test results, end test session
if: success() || failure()
run: |
cat ./junit-acceptance.xml
./slcli test upload-reports --bsid=$BSID --report-location ./junit-acceptance.xml
./slcli test end-stage --bsid=$BSID --executionId "Acceptance Tests"
# Acceptance:
# runs-on: ubuntu-latest
# needs: Initialize
# env:
# BSID: ${{ needs.Initialize.outputs.bsid }}
# SEALIGHTS_CONNECTION_TIMEOUT: 120s
# steps:
# - name: Restore workspace
# uses: actions/cache@v4
# with:
# path: ${{ github.workspace }}
# key: workspace-${{ github.run_id }}

# - name: Update podman
# run: |
# "${GITHUB_WORKSPACE}/hack/ubuntu-podman-update.sh"

# - name: Create a test session
# run: ./slcli test start-stage --bsid=$BSID --testStage "Acceptance Tests"

# - name: Acceptance test
# run: make acceptance-sealights

# - name: Upload test results, end test session
# if: success() || failure()
# run: |
# cat ./junit-acceptance.xml
# ./slcli test upload-reports --bsid=$BSID --report-location ./junit-acceptance.xml
# ./slcli test end-stage --bsid=$BSID --executionId "Acceptance Tests"
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ acceptance-sealights: ## Run all acceptance tests with sealights integration
$(MAKE) build && \
export COVERAGE_FILEPATH="$$ACCEPTANCE_WORKDIR"; \
export COVERAGE_FILENAME="-acceptance"; \
./slcli scan --tests-runner --workspacepath "acceptance" --path-to-scanner ./slgoagent --scm none; \
cd acceptance && SEALIGHTS_LOG_LEVEL=none go run -modfile "$$ACCEPTANCE_WORKDIR/tools/go.mod" gotest.tools/gotestsum --junitfile "$(ROOT_DIR)/junit-acceptance.xml" -- -parallel 1 -timeout $(ACCEPTANCE_TIMEOUT) ./...

# Add @focus above the feature you're hacking on to use this
Expand Down
Loading