get wallet server running with Node v25.9.0#8
Open
mike-parkhill wants to merge 6 commits into
Open
Conversation
076e4f6 to
42b3f84
Compare
Comment on lines
+51
to
+159
| name: ${{ inputs.job_name }} | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Use Node.js 22.x | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22.x | ||
| cache: npm | ||
| cache-dependency-path: package-lock.json | ||
|
|
||
| - name: Install dependencies (monorepo) | ||
| run: npm ci --workspaces | ||
|
|
||
| - name: Build shared package | ||
| run: npm run build:shared | ||
|
|
||
| - name: Build target server | ||
| run: ${{ inputs.build_script }} | ||
|
|
||
| - name: Run tests | ||
| run: ${{ inputs.test_script }} | ||
| working-directory: ${{ inputs.test_working_directory }} | ||
|
|
||
| - name: Run integration tests | ||
| if: inputs.run_integration_tests | ||
| run: ${{ inputs.integration_test_script }} | ||
| working-directory: ${{ inputs.integration_test_working_directory }} | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Build image for scanning | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: ${{ inputs.dockerfile }} | ||
| load: true | ||
| tags: ${{ inputs.image_ref }} | ||
| build-args: | | ||
| BUILD_NUMBER=${{ github.run_number }} | ||
|
|
||
| - name: Scan image for HIGH and CRITICAL vulnerabilities | ||
| id: trivy_scan | ||
| continue-on-error: true | ||
| uses: aquasecurity/trivy-action@v0.35.0 | ||
| with: | ||
| image-ref: ${{ inputs.image_ref }} | ||
| format: table | ||
| output: ${{ inputs.trivy_results_file }} | ||
| ignore-unfixed: true | ||
| severity: HIGH,CRITICAL | ||
| exit-code: '1' | ||
|
|
||
| - name: Add Trivy report to job summary | ||
| if: always() | ||
| run: | | ||
| { | ||
| echo "## ${{ inputs.trivy_scan_label }}" | ||
| echo | ||
| if [ "${{ steps.trivy_scan.outcome }}" = "failure" ]; then | ||
| echo "**Status:** FAILED (HIGH/CRITICAL vulnerabilities found)" | ||
| else | ||
| echo "**Status:** PASSED (no HIGH/CRITICAL vulnerabilities found)" | ||
| fi | ||
| echo | ||
| echo "<details><summary>Full Trivy output</summary>" | ||
| echo | ||
| echo '```text' | ||
| cat "${{ inputs.trivy_results_file }}" | ||
| echo '```' | ||
| echo "</details>" | ||
| } >> "$GITHUB_STEP_SUMMARY" | ||
|
|
||
| - name: Generate Trivy SARIF report | ||
| if: always() | ||
| uses: aquasecurity/trivy-action@v0.35.0 | ||
| with: | ||
| image-ref: ${{ inputs.image_ref }} | ||
| format: sarif | ||
| output: ${{ inputs.trivy_sarif_file }} | ||
| ignore-unfixed: true | ||
| severity: HIGH,CRITICAL | ||
| exit-code: '0' | ||
|
|
||
| - name: Upload Trivy SARIF to GitHub Security | ||
| id: trivy_sarif_upload | ||
| continue-on-error: true | ||
| if: always() | ||
| uses: github/codeql-action/upload-sarif@v4 | ||
| with: | ||
| sarif_file: ${{ inputs.trivy_sarif_file }} | ||
| category: ${{ inputs.sarif_category }} | ||
|
|
||
| - name: Add SARIF upload status to job summary | ||
| if: always() && steps.trivy_sarif_upload.outcome == 'failure' | ||
| run: | | ||
| echo >> "$GITHUB_STEP_SUMMARY" | ||
| echo "## SARIF Upload" >> "$GITHUB_STEP_SUMMARY" | ||
| echo >> "$GITHUB_STEP_SUMMARY" | ||
| echo "SARIF upload was skipped or failed. GitHub code scanning may not be enabled for this repository." >> "$GITHUB_STEP_SUMMARY" | ||
|
|
||
| - name: Fail job if Trivy found HIGH/CRITICAL issues | ||
| if: steps.trivy_scan.outcome == 'failure' | ||
| run: | | ||
| echo "Trivy detected HIGH/CRITICAL vulnerabilities. See job summary and Security tab for details." | ||
| exit 1 |
Comment on lines
+21
to
+90
| name: Build and Publish Image | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| DOCKER_IMAGE: ${{ inputs.docker_image }} | ||
| DOCKERFILE: ${{ inputs.dockerfile }} | ||
| BUILD_NUMBER_FILE: ${{ inputs.build_number_file }} | ||
| SHOULD_PUSH: ${{ inputs.should_push }} | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Read build number | ||
| id: build_number | ||
| run: | | ||
| if [ -f "${BUILD_NUMBER_FILE}" ]; then | ||
| BUILD_NUM=$(cat "${BUILD_NUMBER_FILE}") | ||
| echo "Using ${BUILD_NUMBER_FILE}" | ||
| else | ||
| BUILD_NUM="${{ github.run_number }}" | ||
| echo "${BUILD_NUMBER_FILE} not found; using GitHub run number" | ||
| fi | ||
| echo "build_number=$BUILD_NUM" >> "$GITHUB_OUTPUT" | ||
| echo "Build number: $BUILD_NUM" | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Log in to DockerHub | ||
| if: ${{ env.SHOULD_PUSH == 'true' }} | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
| password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | ||
|
|
||
| - name: Extract metadata for Docker | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: | | ||
| ${{ env.DOCKER_IMAGE }} | ||
| tags: | | ||
| type=raw,value=latest,enable=${{ github.event_name == 'release' && github.event.release.target_commitish == github.event.repository.default_branch }} | ||
| type=raw,value=${{ steps.build_number.outputs.build_number }} | ||
| labels: | | ||
| org.opencontainers.image.licenses=LicenseRef-DL-NPL | ||
|
|
||
| - name: Build and publish Docker image | ||
| id: docker_build | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: ${{ env.DOCKERFILE }} | ||
| push: ${{ env.SHOULD_PUSH == 'true' }} | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| sbom: ${{ env.SHOULD_PUSH == 'true' }} | ||
| provenance: ${{ env.SHOULD_PUSH == 'true' }} | ||
| build-args: | | ||
| BUILD_NUMBER=${{ steps.build_number.outputs.build_number }} | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
| platforms: linux/amd64,linux/arm64 | ||
|
|
||
| - name: Image digest | ||
| if: ${{ env.SHOULD_PUSH == 'true' }} | ||
| run: echo "Image pushed with digest ${{ steps.docker_build.outputs.digest }}" | ||
|
|
||
| - name: Image build only | ||
| if: ${{ env.SHOULD_PUSH != 'true' }} | ||
| run: echo "Image built without push because workflow_dispatch input 'push' was false" |
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.