chore(dep): Bumped golang.org/x/net to 0.56.0 to avoid known CVEs
#58
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
| # Copyright 2018-present Sonatype Inc. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| name: Build | |
| on: | |
| pull_request: | |
| paths-ignore: | |
| - 'README.md' | |
| push: | |
| branches: | |
| - main | |
| env: | |
| LC_APPLICATION_ID: nancy | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| GO111MODULE: 'on' | |
| TEST_RESULTS: /tmp/test-results | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup Go | |
| uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| - name: Create test results directory | |
| run: mkdir -p $TEST_RESULTS/gotest | |
| - name: Check headers | |
| run: | | |
| go install github.com/google/addlicense@latest | |
| addlicense -check -f ./header.txt ./*.go | |
| - name: Download dependencies | |
| run: | | |
| go mod download | |
| go mod verify | |
| go mod tidy | |
| - name: Lint | |
| uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0 | |
| with: | |
| version: v2.12.1 | |
| - name: Run tests | |
| run: | | |
| go build ./... | |
| go test -v ./... 2>&1 | tee /tmp/gotest.out | |
| - name: Generate JUnit report | |
| run: | | |
| go install github.com/jstemmer/go-junit-report@latest | |
| go-junit-report < /tmp/gotest.out > $TEST_RESULTS/gotest/report.xml | |
| if: always() | |
| - name: Run integration tests | |
| if: ${{ !github.event.pull_request.head.repo.fork }} | |
| env: | |
| GUIDE_TOKEN: ${{ secrets.SONATYPE_GUIDE_TOKEN }} | |
| IT_EXCLUDED_VULNS: CVE-2021-3121,CVE-2022-21698,CVE-2022-29153,sonatype-2021-1401,CVE-2023-32731,CVE-2023-45142,CVE-2024-10086,CVE-2023-29407,CVE-2023-29408,CVE-2022-41727 | |
| run: | | |
| go build -o nancy . | |
| mkdir -p dist | |
| go list -json -deps ./... | ./nancy sleuth | |
| go list -json -deps | ./nancy sleuth | |
| go list -json -m all | ./nancy sleuth --exclude-vulnerability "$IT_EXCLUDED_VULNS" | |
| go list -m all | ./nancy sleuth --exclude-vulnerability "$IT_EXCLUDED_VULNS" | |
| go list -json -deps ./... > dist/deps.out && ./nancy sleuth < dist/deps.out | |
| go list -json -deps > dist/deps.out && ./nancy sleuth < dist/deps.out | |
| go list -json -m all > dist/deps.out && ./nancy sleuth --exclude-vulnerability "$IT_EXCLUDED_VULNS" < dist/deps.out | |
| go list -m all > dist/deps.out && ./nancy sleuth --exclude-vulnerability "$IT_EXCLUDED_VULNS" < dist/deps.out | |
| - name: Run OSS Index compat integration tests | |
| if: ${{ !github.event.pull_request.head.repo.fork }} | |
| env: | |
| OSSI_USERNAME: ${{ secrets.OSSI_USERNAME }} | |
| OSSI_TOKEN: ${{ secrets.OSSI_TOKEN }} | |
| IT_EXCLUDED_VULNS: CVE-2021-3121,CVE-2022-21698,CVE-2022-29153,sonatype-2021-1401,CVE-2023-32731,CVE-2023-45142,CVE-2024-10086,CVE-2023-29407,CVE-2023-29408,CVE-2022-41727 | |
| run: | | |
| go list -json -deps ./... | ./nancy sleuth | |
| go list -json -m all | ./nancy sleuth --exclude-vulnerability "$IT_EXCLUDED_VULNS" | |
| - name: Run Lifecycle integration tests | |
| if: ${{ !github.event.pull_request.head.repo.fork }} | |
| env: | |
| IQ_USERNAME: ${{ secrets.SONATYPE_LIFECYCLE_USERNAME }} | |
| IQ_TOKEN: ${{ secrets.SONATYPE_LIFECYCLE_PASSWORD }} | |
| IQ_SERVER: ${{ vars.SONATYPE_PLATFORM_URL }} | |
| run: | | |
| go list -json -deps ./... | ./nancy lifecycle \ | |
| --lifecycle-application "$LC_APPLICATION_ID" \ | |
| --lifecycle-stage develop | |
| - name: Upload test results | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| if: always() | |
| with: | |
| name: test-results | |
| path: /tmp/test-results/ | |
| - name: Publish test results | |
| uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2.23.0 | |
| if: always() | |
| with: | |
| files: /tmp/test-results/**/report.xml | |
| check_name: Test Results | |
| sonatype: | |
| name: Sonatype Lifecycle | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| if: ${{ !github.event.pull_request.head.repo.fork }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup Go | |
| uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| - name: Generate go.list | |
| run: go list -f '{{define "M"}}{{.Path}} {{.Version}}{{end}}{{with .Module}}{{if not .Main}}{{if .Replace}}{{template "M" .Replace}}{{else}}{{template "M" .}}{{end}}{{end}}{{end}}' -compiled -deps| sort -u > go.list | |
| - name: Sonatype Lifecycle Evaluation | |
| id: evaluate | |
| uses: sonatype/actions/evaluate@v1 | |
| with: | |
| iq-server-url: ${{ vars.SONATYPE_PLATFORM_URL }} | |
| username: ${{ secrets.SONATYPE_LIFECYCLE_USERNAME }} | |
| password: ${{ secrets.SONATYPE_LIFECYCLE_PASSWORD }} | |
| application-id: ${{ env.LC_APPLICATION_ID }} | |
| scan-targets: 'go.list' |