From fed4c5a132c703de4074c5755879cd3e39cd9976 Mon Sep 17 00:00:00 2001 From: Tom <73077675+tmzane@users.noreply.github.com> Date: Wed, 3 May 2023 19:04:05 +0300 Subject: [PATCH] ci: reuse the `checks` workflow --- .github/workflows/checks.yml | 20 ++++++++++++++ .github/workflows/go.yml | 52 ------------------------------------ README.md | 6 ++--- 3 files changed, 23 insertions(+), 55 deletions(-) create mode 100644 .github/workflows/checks.yml delete mode 100644 .github/workflows/go.yml diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 0000000..95c05de --- /dev/null +++ b/.github/workflows/checks.yml @@ -0,0 +1,20 @@ +name: checks + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + schedule: + - cron: '0 0 * * MON' + workflow_dispatch: + +jobs: + test: + uses: go-simpler/.github/.github/workflows/test.yml@runs-on-input + with: + runs-on: '[ "ubuntu-latest", "macos-latest", "windows-latest" ]' + lint: + uses: go-simpler/.github/.github/workflows/lint.yml@main + vuln: + uses: go-simpler/.github/.github/workflows/vuln.yml@main diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml deleted file mode 100644 index 771f61d..0000000 --- a/.github/workflows/go.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: go - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - schedule: - - cron: "0 0 * * MON" - workflow_dispatch: - -jobs: - test: - strategy: - matrix: - go: [ oldstable, stable ] - os: [ ubuntu-latest, macos-latest, windows-latest ] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set up Go ${{ matrix.go }} - uses: actions/setup-go@v4 - with: - go-version: ${{ matrix.go }} - - - name: Run tests - # do not use `=` to join flags and values, it won't work on Windows; - # see https://github.com/PowerShell/PowerShell/issues/6291 for details. - run: go test -v -race -shuffle on -coverprofile coverage.out ./... - - - name: Upload coverage - uses: codecov/codecov-action@v3 - with: - files: ./coverage.out - - lint: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version-file: go.mod - - - name: Run linters - uses: golangci/golangci-lint-action@v3 - with: - version: v1.50.0 diff --git a/README.md b/README.md index 01d88ec..21b9e89 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # musttag -[![ci](https://github.com/tmzane/musttag/actions/workflows/go.yml/badge.svg)](https://github.com/tmzane/musttag/actions/workflows/go.yml) -[![docs](https://pkg.go.dev/badge/go.tmz.dev/musttag.svg)](https://pkg.go.dev/go.tmz.dev/musttag) -[![report](https://goreportcard.com/badge/go.tmz.dev/musttag)](https://goreportcard.com/report/go.tmz.dev/musttag) +[![checks](https://github.com/tmzane/musttag/actions/workflows/checks.yml/badge.svg)](https://github.com/tmzane/musttag/actions/workflows/checks.yml) +[![pkg.go.dev](https://pkg.go.dev/badge/go.tmz.dev/musttag.svg)](https://pkg.go.dev/go.tmz.dev/musttag) +[![goreportcard](https://goreportcard.com/badge/go.tmz.dev/musttag)](https://goreportcard.com/report/go.tmz.dev/musttag) [![codecov](https://codecov.io/gh/tmzane/musttag/branch/main/graph/badge.svg)](https://codecov.io/gh/tmzane/musttag) A Go linter that enforces field tags in (un)marshaled structs