github.com/redhat-appstudio/e2e-tests@v0.0.0-20230619105049-9a422b2094d7/.github/workflows/PR.yaml (about)

     1  name: Validate PR
     2  on:
     3    pull_request:
     4  jobs:
     5    static_checks:
     6      name: lint
     7      runs-on: ubuntu-latest
     8      steps:
     9        - uses: actions/checkout@v2
    10        - name: Setup Golang
    11          uses: actions/setup-go@v2
    12          with:
    13            go-version: 1.19
    14        - name: golangci-lint
    15          uses: golangci/golangci-lint-action@v2
    16          with:
    17            args: --timeout=5m
    18        - name: Run Gosec Security Scanner
    19          uses: securego/gosec@master
    20          with:
    21            # we let the report trigger content trigger a failure using the GitHub Security features.
    22            args: '-no-fail -fmt sarif -out results.sarif ./...'
    23        - name: Upload SARIF file
    24          uses: github/codeql-action/upload-sarif@v1
    25          with:
    26            # Path to SARIF file relative to the root of the repository
    27            sarif_file: results.sarif
    28  
    29    image_build:
    30      name: Check docker build
    31      runs-on: ubuntu-latest
    32      steps:
    33        - name: Check out code into the Go module directory
    34          uses: actions/checkout@v2
    35          with:
    36            fetch-depth: 0
    37        - name: Check if dockerimage build is working
    38          run: docker build -f ./Dockerfile .
    39  
    40    unit_tests:
    41      name: Unit tests
    42      runs-on: ubuntu-latest
    43      steps:
    44        - uses: actions/checkout@v2
    45        - name: Setup Golang
    46          uses: actions/setup-go@v2
    47        - name: Run unit tests
    48          run: go test -v ./pkg/... ./magefiles/...