Skip to content

build

build #445

Workflow file for this run

name: build
on: [push, pull_request]
jobs:
lint:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.repository != github.event.pull_request.head.repo.full_name)
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.22.x
- uses: actions/checkout@v4
- uses: golangci/golangci-lint-action@v3
with:
version: v1.55.2
test:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.repository != github.event.pull_request.head.repo.full_name)
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.22.x
- uses: actions/checkout@v4
- run: go build ./cmd/goverter
- run: go test -coverpkg ./... -coverprofile=coverage.txt -covermode=atomic ./...
- run: grep -v '/example/' coverage.txt > filtered-coverage.txt
- uses: codecov/codecov-action@v4
with:
disable_search: true
files: ./filtered-coverage.txt
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
test_go118:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.repository != github.event.pull_request.head.repo.full_name)
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.18.x
- uses: actions/checkout@v4
- run: go build ./cmd/goverter
- run: go test ./...
env:
SKIP_VERSION_DEPENDENT: 'true'
generate:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.repository != github.event.pull_request.head.repo.full_name)
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: "1.21.x"
- uses: actions/checkout@v4
- run: mkdir covdata
- run: GOCOVERDIR="$PWD/covdata" go generate ./...
- run: go tool covdata textfmt -i=./covdata -o example-coverage.txt
- uses: codecov/codecov-action@v4
with:
disable_search: true
files: ./example-coverage.txt
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- run: git diff --exit-code
- if: failure()
run: echo "::error::Check failed, please run 'go generate ./...' and commit the changes."
build_docs:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.repository != github.event.pull_request.head.repo.full_name)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
cache-dependency-path: docs/yarn.lock
- working-directory: docs
run: |
yarn install --frozen-lockfile
yarn docs:build