chore(deps): update anchore/sbom-action action to v0.17.8 #1308
This file contains 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: Linting and Test | |
# Run for all pushes to main and pull requests when Go or YAML files change | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
golangci: | |
name: lint-and-test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.21' | |
- name: Install cockroach binary | |
run: curl https://binaries.cockroachdb.com/cockroach-v21.1.7.linux-amd64.tgz | tar -xz && sudo cp -i cockroach-v21.1.7.linux-amd64/cockroach /usr/local/bin/ | |
- name: Start test database | |
run: cockroach start-single-node --insecure --background | |
- name: Create test DB | |
run: make test-database | |
- name: Run golangci-lint | |
uses: golangci/golangci-lint-action@v4 | |
with: | |
version: v1.54.2 | |
args: --timeout=5m | |
skip-pkg-cache: true | |
- name: Run go tests for generated models code | |
run: go test -race ./internal/models | |
# Don't include the models test that we tested above already. We don't want to calculate the test coverage from these into the app since we can't affect it | |
- name: Run go tests and generate coverage report | |
run: METADATASERVICE_DB_URI="host=localhost port=26257 user=root sslmode=disable dbname=metadataservice_test" go test -race -coverprofile=coverage.txt -covermode=atomic -tags testtools -p 1 `go list ./... | grep -v internal/models` | |
- name: Stop test database | |
run: cockroach quit --insecure --host=localhost:26257 | |
- name: Upload coverage report | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage.txt | |
flags: unittests | |
name: codecov-umbrella |