trpc.group/trpc-go/trpc-go@v1.0.3/.github/workflows/prc.yml (about)

     1  name: Pull Request Check
     2  on:
     3    pull_request:
     4    push:
     5    workflow_dispatch:
     6  permissions:
     7    contents: read
     8    pull-requests: read # Use with `only-new-issues` option.
     9  jobs:
    10    build:
    11      name: build
    12      runs-on: self-hosted
    13      steps:
    14      - uses: actions/checkout@v3
    15      - uses: actions/setup-go@v4
    16        with:
    17          go-version: 1.19
    18      - name: Build
    19        run: go build -v ./...
    20      - name: Test
    21        run: go test -v -coverprofile=coverage.out ./...
    22      - name: Upload coverage reports to Codecov
    23        uses: codecov/codecov-action@v3
    24        with:
    25          files: coverage.out
    26          flags: unittests
    27        env:
    28          CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
    29    golangci:
    30      name: lint
    31      if: github.event_name == 'pull_request'
    32      runs-on: ubuntu-latest
    33      steps:
    34        - uses: actions/setup-go@v4
    35          with:
    36            go-version: 1.19
    37        - uses: actions/checkout@v3
    38        - name: golangci-lint
    39          uses: golangci/golangci-lint-action@v3
    40          with:
    41            version: latest 
    42            only-new-issues: true
    43            skip-cache: true # To prevent occasional failure of this action.
    44    typos:
    45      name: typos
    46      runs-on: ubuntu-latest
    47      steps:
    48      - uses: actions/checkout@v3
    49      - name: typos 
    50        uses: crate-ci/typos@master
    51    go-apidiff:
    52      if: github.event_name == 'pull_request'
    53      runs-on: ubuntu-latest
    54      steps:
    55      - uses: actions/checkout@v3
    56        with:
    57          fetch-depth: 0 
    58      - uses: actions/setup-go@v4
    59        with:
    60          go-version: 1.19
    61      - uses: joelanford/go-apidiff@main