Skip to content

Add tests for every contract endpoint. (#90) #188

Add tests for every contract endpoint. (#90)

Add tests for every contract endpoint. (#90) #188

# Copyright 2024 go-dataspace
#
# 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
#
# https://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: Test and build
on:
pull_request:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version:
- 1.23.3
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
name: Setup Go ${{ matrix.go-version }}
with:
go-version: ${{ matrix.go-version }}
- name: tests
run: make test
lint:
runs-on: ubuntu-latest
strategy:
matrix:
go-version:
- 1.23.3
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
name: Setup Go ${{ matrix.go-version }}
with:
go-version: ${{ matrix.go-version }}
- name: lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.62.2
vulncheck:
runs-on: ubuntu-latest
strategy:
matrix:
go-version:
- 1.23.3
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
name: Setup Go ${{ matrix.go-version }}
with:
go-version: ${{ matrix.go-version }}
- name: Install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest
- name: Run govulncheck
run: make vulncheck
build:
runs-on: ubuntu-latest
needs:
- test
- lint
- vulncheck
strategy:
matrix:
go-version:
- 1.23.3
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
name: Setup Go ${{ matrix.go-version }}
with:
go-version: ${{ matrix.go-version }}
- name: tests
run: make build