github.com/hashicorp/hcl/v2@v2.20.0/.github/workflows/checks.yml (about)

     1  name: Checks
     2  
     3  on:
     4    push:
     5    workflow_dispatch:
     6    pull_request:
     7  
     8  jobs:
     9    unit_tests:
    10      strategy:
    11        matrix:
    12          include:
    13            - runs-on: ubuntu-latest
    14              target: linux_amd64
    15            - runs-on: windows-latest
    16              target: windows_amd64
    17            - runs-on: macos-latest
    18              target: darwin_amd64
    19        fail-fast: false
    20  
    21      name: "Unit Tests on ${{ matrix.target }}"
    22      runs-on: "${{ matrix.runs-on }}"
    23      steps:
    24        - name: "Disable git crlf conversions"
    25          if: ${{ runner.os == 'Windows' }}
    26          # HCL preserves the input line endings when processing a heredoc,
    27          # and our tests for heredocs are written to expect the result for
    28          # the source code as checked in to the repository, so git's normal
    29          # tampering with the line endings would invalidate those tests.
    30          run: |
    31            git config --global core.autocrlf false
    32        - name: "Fetch source code"
    33          uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
    34        - name: Install Go
    35          uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
    36          with:
    37            go-version-file: go.mod
    38        - name: Go test
    39          run: |
    40            go test ./... -race
    41  
    42    copyright:
    43      name: "copyright headers"
    44      runs-on: ubuntu-latest
    45      steps:
    46        - name: "Fetch source code"
    47          uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
    48        - name: Install Go
    49          uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
    50          with:
    51            go-version-file: go.mod
    52        - name: "copyright headers check"
    53          run: |
    54            make copyrightcheck
    55  
    56    govet:
    57      name: "go vet"
    58      runs-on: ubuntu-latest
    59      steps:
    60        - name: "Fetch source code"
    61          uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
    62        - name: Install Go
    63          uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
    64          with:
    65            go-version-file: go.mod
    66        - name: "go vet"
    67          run: |
    68            make vetcheck
    69  
    70    gofmt:
    71      name: "gofmt"
    72      runs-on: ubuntu-latest
    73      steps:
    74        - name: "Fetch source code"
    75          uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
    76        - name: Install Go
    77          uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
    78          with:
    79            go-version-file: go.mod
    80        - name: "gofmt"
    81          run: |
    82            make fmtcheck