github.com/google/go-safeweb@v0.0.0-20231219055052-64d8cfc90fbb/.github/workflows/main.yaml (about)

     1  name: Go
     2  
     3  on:
     4    push:
     5      branches: [ master ]
     6    pull_request:
     7      branches: [ master ]
     8  
     9  jobs:
    10  
    11    build:
    12      name: build
    13      runs-on: ubuntu-latest
    14      steps:
    15  
    16      - name: Set up Go 1.x
    17        uses: actions/setup-go@v3
    18        with:
    19          go-version: '1.20'
    20        id: go
    21  
    22      - name: Check out code into the Go module directory
    23        uses: actions/checkout@v3
    24  
    25      - name: Build
    26        run: go build -v ./...
    27   
    28    test:
    29      name: test 
    30      runs-on: ubuntu-latest
    31      steps:
    32  
    33      - name: Set up Go 1.x
    34        uses: actions/setup-go@v3
    35        with:
    36          go-version: '1.20'
    37        id: go
    38  
    39      - name: Check out code into the Go module directory
    40        uses: actions/checkout@v3
    41  
    42      - name: Test
    43        run: go test -vet=all -v ./...
    44    
    45    gofmt:
    46      name: gofmt
    47      runs-on: ubuntu-latest
    48      steps:
    49  
    50      - name: Set up Go 1.x
    51        uses: actions/setup-go@v3
    52        with:
    53          go-version: '1.20'
    54        id: go
    55  
    56      - name: Check out code into the Go module directory
    57        uses: actions/checkout@v3
    58  
    59      - name: Ensure all files were formatted as per gofmt
    60        run: |
    61          [ "$(gofmt -l $(find . -name '*.go') 2>&1)" = "" ]
    62  
    63    copyright:
    64      name: copyright
    65      runs-on: ubuntu-latest
    66      steps:
    67  
    68      - name: Set up Go 1.x
    69        uses: actions/setup-go@v3
    70        with:
    71          go-version: '1.20'
    72        id: go
    73  
    74      - name: Check out code into the Go module directory
    75        uses: actions/checkout@v3
    76  
    77      - name: Copyright linter - Go
    78        run: |
    79          ./.github/workflows/copyright_linter.sh ./.github/workflows/go-copyright-header.txt go
    80  
    81      - name: Copyright linter - HTML
    82        run: |
    83          ./.github/workflows/copyright_linter.sh ./.github/workflows/html-copyright-header.txt html
    84  
    85      - name: Copyright linter - JavaScript
    86        run: |
    87          ./.github/workflows/copyright_linter.sh ./.github/workflows/js-copyright-header.txt js