...

Text file src/github.com/gabriel-vasile/mimetype/.github/workflows/go.yml

Documentation: github.com/gabriel-vasile/mimetype/.github/workflows

     1name: Run Tests
     2on:
     3  push:
     4    branches:
     5      - master
     6  pull_request:
     7
     8permissions:
     9  contents: read
    10
    11jobs:
    12  lint:
    13    runs-on: ubuntu-latest
    14    steps:
    15    - name: Install Go
    16      uses: actions/setup-go@v4.1.0
    17      with:
    18        go-version: "1.18.x"
    19    - name: Checkout code
    20      uses: actions/checkout@v4.1.0
    21    - name: Run linters
    22      uses: golangci/golangci-lint-action@v3.7.0
    23      with:
    24        version: "v1.45.2"
    25
    26  test:
    27    strategy:
    28      matrix:
    29        platform: [ubuntu-latest, windows-latest]
    30    runs-on: ${{ matrix.platform }}
    31    steps:
    32    - name: Install Go
    33      if: success()
    34      uses: actions/setup-go@v4.1.0
    35      with:
    36        go-version: "1.18.x"
    37    - name: Checkout code
    38      uses: actions/checkout@v4.1.0
    39    - run: go test -race ./...
    40    - run: go test -fuzz=. -fuzztime=30s
    41    - run: go test -fuzz=Plain -fuzztime=30s ./internal/charset
    42    - run: go test -fuzz=XML -fuzztime=30s ./internal/charset
    43    - run: go test -fuzz=HTML -fuzztime=30s ./internal/charset
    44
    45  coverage:
    46    runs-on: ubuntu-latest
    47    steps:
    48    - uses: actions/checkout@v4.1.0
    49    - name: Install Go
    50      if: success()
    51      uses: actions/setup-go@v4.1.0
    52      with:
    53        go-version: "1.18.x"
    54    - name: Generate coverage
    55      run: go test -race -covermode=atomic -coverprofile=coverage.out
    56    - uses: codecov/codecov-action@v3.1.4
    57      with:
    58        files: ./coverage.out

View as plain text